Skip to content

Commit

Permalink
[hotfix] emergency!!!
Browse files Browse the repository at this point in the history
  • Loading branch information
gunyu1019 committed Aug 18, 2023
1 parent 9ccc407 commit f329b1f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions src/firebase/root.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,18 @@ auth.onAuthStateChanged(async user => {
badgeDocs.forEach(v => badges.push(v.id));
for (const badgeId of badges) {
const badge = await GetBadgeData(badgeId);
if (!badge.success) console.error(badge.error);
if (!badge.success) {
console.error(badge.error);
continue;
}
const mybadgeDoc = await GetDocFromCollection(
USER_COLLECTION_ID,
user.uid,
MYBADGE_COLLECTION_ID,
badge.data.id,
);
if (mybadgeDoc.exists() && mybadgeDoc.data().addedTime) continue;
console.log(badge.data.eventName);
for (const eventName of badge.data.eventName) {
if (!window.everflowEvents) window.everflowEvents = [eventName];
else window.everflowEvents.push(eventName);
Expand All @@ -63,7 +67,8 @@ auth.onAuthStateChanged(async user => {
MYBADGE_COLLECTION_ID,
badge.data.id,
);
if (!badgeDoc.exists()) console.error(DOES_NOT_EXIST_DOC);
if (!badgeDoc.exists())
return console.error(DOES_NOT_EXIST_DOC);
if (badgeDoc.data().progressValue >= badge.data.goalValue) {
const status = await AddBadgeAddedTime(
user.uid,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/mybadge/badgeList.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ const badgeList = [
type: 'test',
level: 5, // date: new Date(),
active: false,
achievement: 100,
achievement: 10,
achievementCommentSuffix: 'tests',
},
];
Expand Down

0 comments on commit f329b1f

Please sign in to comment.