mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-16 19:57:52 +01:00
web: fix automatic backup reminder setting reverting to never (#8037)
Signed-off-by: 01zulfi <85733202+01zulfi@users.noreply.github.com>
This commit is contained in:
@@ -86,9 +86,12 @@ export async function scheduleFullBackups() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function shouldAddAutoBackupsDisabledNotice() {
|
export async function shouldAddAutoBackupsDisabledNotice() {
|
||||||
|
const user = await db.user.getUser();
|
||||||
|
if (!user) return false;
|
||||||
|
|
||||||
const backupInterval = Config.get("backupReminderOffset", 0);
|
const backupInterval = Config.get("backupReminderOffset", 0);
|
||||||
if (!isUserPremium() && backupInterval) {
|
if (!isUserPremium(user) && backupInterval) {
|
||||||
Config.set("backupReminderOffset", 0);
|
Config.set("backupReminderOffset", 0);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -177,7 +180,7 @@ export const NoticesData: Record<NoticeType, NoticeData> = {
|
|||||||
export async function resetNotices() {
|
export async function resetNotices() {
|
||||||
const notices: Notice[] = [];
|
const notices: Notice[] = [];
|
||||||
|
|
||||||
if (shouldAddAutoBackupsDisabledNotice()) {
|
if (await shouldAddAutoBackupsDisabledNotice()) {
|
||||||
notices.push({ type: "autoBackupsOff", priority: 3 });
|
notices.push({ type: "autoBackupsOff", priority: 3 });
|
||||||
}
|
}
|
||||||
if (await shouldAddBackupNotice()) {
|
if (await shouldAddBackupNotice()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user