Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
compareDaily: async (props, { user }) => {
const dailyVisits = await incrementDailyReward();
if (dailyVisits !== user.dailyVisits) {
// console.log('Yay! You came back, your streak is now at: ' + dailyVisits);
dispatch.dailyStreak.set(dailyVisits);
if (dailyVisits > user.dailyVisits) {
dispatch.dailyStreak.rewardUser(dailyVisits);
}
dispatch.user.update({ dailyVisits });
// / Give reward!
} else {
// console.log('ummmm', dailyVisits);
}
},
},
compareDaily = async () => {
const dailyVisits = await this.incrementDailyReward();
if (dailyVisits != this.userData.dailyVisits) {
// console.log('Yay! You came back, your streak is now at: ' + dailyVisits);
dispatch.dailyStreak.assign(dailyVisits);
if (dailyVisits > this.userData.dailyVisits) {
dispatch.dailyStreak.rewardUser(dailyVisits);
}
this.userData.dailyVisits = dailyVisits;
/// Give reward!
} else {
// console.log('ummmm', dailyVisits);
}
};
compareDaily = async () => {
const dailyVisits = await this.incrementDailyReward();
if (dailyVisits != this.userData.dailyVisits) {
// console.log('Yay! You came back, your streak is now at: ' + dailyVisits);
dispatch.dailyStreak.assign(dailyVisits);
if (dailyVisits > this.userData.dailyVisits) {
dispatch.dailyStreak.rewardUser(dailyVisits);
}
this.userData.dailyVisits = dailyVisits;
/// Give reward!
} else {
// console.log('ummmm', dailyVisits);
}
};
compareDaily: async (props, { user }) => {
const dailyVisits = await incrementDailyReward();
if (dailyVisits !== user.dailyVisits) {
// console.log('Yay! You came back, your streak is now at: ' + dailyVisits);
dispatch.dailyStreak.set(dailyVisits);
if (dailyVisits > user.dailyVisits) {
dispatch.dailyStreak.rewardUser(dailyVisits);
}
dispatch.user.update({ dailyVisits });
// / Give reward!
} else {
// console.log('ummmm', dailyVisits);
}
},
},
compareDaily = async () => {
const dailyVisits = await this.incrementDailyReward();
if (dailyVisits != this.userData.dailyVisits) {
// console.log('Yay! You came back, your streak is now at: ' + dailyVisits);
dispatch.dailyStreak.assign(dailyVisits);
if (dailyVisits > this.userData.dailyVisits) {
dispatch.dailyStreak.rewardUser(dailyVisits);
}
this.userData.dailyVisits = dailyVisits;
/// Give reward!
} else {
// console.log('ummmm', dailyVisits);
}
};
compareDaily = async () => {
const dailyVisits = await this.incrementDailyReward();
if (dailyVisits != this.userData.dailyVisits) {
// console.log('Yay! You came back, your streak is now at: ' + dailyVisits);
dispatch.dailyStreak.assign(dailyVisits);
if (dailyVisits > this.userData.dailyVisits) {
dispatch.dailyStreak.rewardUser(dailyVisits);
}
this.userData.dailyVisits = dailyVisits;
/// Give reward!
} else {
// console.log('ummmm', dailyVisits);
}
};
...nextFirebaseAuthData,
};
const updates = {};
for (const key of Object.keys(combinedUserData)) {
if (
combinedUserData[key] != undefined &&
combinedUserData[key] !== nextLocalUserData[key]
) {
updates[key] = combinedUserData[key];
}
}
if (Object.keys(updates).length > 0) {
dispatch.user.update(updates);
}
dispatch.dailyStreak.compareDaily();
dispatch.players.update({
uid: combinedUserData.uid,
user: combinedUserData,
});
if (Settings.isCacheProfileUpdateActive) {
const shouldUpdateKey = '@PillarValley/shouldUpdateProfile';
const something = await getItemWithExpiration(shouldUpdateKey);
if (!something) {
const some = await setItemWithExpiration(
shouldUpdateKey,
{ update: true },
Settings.shouldDelayFirebaseProfileSyncInMinutes,
);
dispatch.user.syncLocalToFirebase();
} else {