Fix error when adding a background to a list which did not have one before
continuous-integration/drone/push Build is passing Details

This commit is contained in:
kolaente 2020-05-31 21:38:07 +02:00
parent 3441072c2c
commit 6b6b0af819
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 10 additions and 0 deletions

View File

@ -46,10 +46,20 @@ export const store = new Vuex.Store({
[CURRENT_LIST](state, currentList) {
// Not sure if this is the right way to do it but hey, it works
if (
// List changed
currentList.id !== state.currentList.id ||
// The current list got a new background and didn't have one previously
(
currentList.backgroundInformation &&
!state.currentList.backgroundInformation
) ||
// The current list got a new background and had one previously
(
currentList.backgroundInformation &&
currentList.backgroundInformation.unsplashId &&
state.currentList &&
state.currentList.backgroundInformation &&
state.currentList.backgroundInformation.unsplashId &&
currentList.backgroundInformation.unsplashId !== state.currentList.backgroundInformation.unsplashId
)
) {