A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
fix: reset reminders on login
thecodrrd122f9a569ed
diff --git a/apps/web/src/app.js b/apps/web/src/app.jsindex ea226587b..ef59bae99 100644--- a/apps/web/src/app.js+++ b/apps/web/src/app.js@@ -13,10 +13,7 @@ import routes from "./navigation/routes";import Editor from "./components/editor";import useMobile from "./utils/use-mobile";import GlobalMenuWrapper from "./components/globalmenuwrapper";-import {- shouldAddBackupReminder,- shouldAddSignupReminder,-} from "./common/reminders";+import { resetReminders } from "./common/reminders";import { isUserPremium } from "./common";import { EV } from "notes-core/common";import useTablet from "./utils/use-tablet";@@ -45,12 +42,7 @@ function App() {initUser();initNotes();(async function () {- if (await shouldAddBackupReminder()) {- addReminder("backup", "high");- }- if (await shouldAddSignupReminder()) {- addReminder("signup", "low");- }+ await resetReminders();})();},[refreshColors, refreshMenuPins, initUser, initNotes, addReminder]diff --git a/apps/web/src/common/reminders.js b/apps/web/src/common/reminders.jsindex 1ce8b87f7..a21137471 100644--- a/apps/web/src/common/reminders.js+++ b/apps/web/src/common/reminders.js@@ -1,5 +1,6 @@import Config from "../utils/config";import { createBackup, db } from "./index";+import { store as appStore } from "../stores/app-store";import * as Icon from "../components/icons";import dayjs from "dayjs";import { showSignUpDialog } from "../components/dialogs/signupdialog";@@ -32,3 +33,13 @@ export const Reminders = {icon: Icon.Login,},};++export async function resetReminders() {+ appStore.set((state) => (state.reminders = []));+ if (await shouldAddBackupReminder()) {+ appStore.addReminder("backup", "high");+ }+ if (await shouldAddSignupReminder()) {+ appStore.addReminder("signup", "low");+ }+}diff --git a/apps/web/src/stores/app-store.js b/apps/web/src/stores/app-store.jsindex 83d887ae2..7f57b4cd7 100644--- a/apps/web/src/stores/app-store.js+++ b/apps/web/src/stores/app-store.js@@ -9,6 +9,7 @@ import BaseStore from "./index";import { isMobile } from "../utils/dimensions";import { showToast } from "../utils/toast";import { toTitleCase } from "../utils/string";+import { resetReminders } from "../common/reminders";class AppStore extends BaseStore {// default state@@ -25,9 +26,10 @@ class AppStore extends BaseStore {notebookStore.refresh();trashStore.refresh();tagStore.refresh();- await editorStore.openLastSession();+ editorStore.openLastSession();this.refreshColors();this.refreshMenuPins();+ await resetReminders();};refreshColors = () => {