Skip to content

Commit

Permalink
#36 뻐킹 로드 시점 문제
Browse files Browse the repository at this point in the history
  • Loading branch information
stories2 committed Jun 23, 2021
1 parent 72c09f7 commit 3c849f9
Showing 1 changed file with 24 additions and 22 deletions.
46 changes: 24 additions & 22 deletions public/src/artist.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,27 +108,29 @@ function responsiveBlockList() {
})
}

firebase.firestore().collection("page").doc("utaconne-landing").get()
.then((snapshot) => {
if (snapshot.exists && snapshot.data().artist && snapshot.data().artist.length === 7) {
artistDataList = snapshot.data().artist
artistDataList.forEach(item => {
if (item.desc) {
item.desc = item.desc.replace(/\\n/g, '\n');
}
})
} else {
window.onload = () => {
firebase.firestore().collection("page").doc("utaconne-landing").get()
.then((snapshot) => {
if (snapshot.exists && snapshot.data().artist && snapshot.data().artist.length === 7) {
artistDataList = snapshot.data().artist
artistDataList.forEach(item => {
if (item.desc) {
item.desc = item.desc.replace(/\\n/g, '\n');
}
})
} else {
analytics.logEvent('artist-init-list', {
status: 'warn',
message: 'Wrong artist data received.'
});
}
init();
responsiveBlockList();
})
.catch(err => {
analytics.logEvent('artist-init-list', {
status: 'warn',
message: 'Wrong artist data received.'
status: 'fail',
message: err.message
});
}
init();
responsiveBlockList();
})
.catch(err => {
analytics.logEvent('artist-init-list', {
status: 'fail',
message: err.message
});
})
})
}

0 comments on commit 3c849f9

Please sign in to comment.