Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix: install timeago.js package

thecodrrf95dabe7f241
diff --git a/apps/web/package.json b/apps/web/package.json
index 86e4dce74..afb879e38 100644
--- a/apps/web/package.json
+++ b/apps/web/package.json
@@ -48,6 +48,7 @@
"react-virtuoso": "^1.9.3",
"rebass": "^4.0.7",
"streamablefs": "file:packages/streamablefs",
+ "timeago.js": "^4.0.2",
"tinymce": "^5.10.0",
"uzip": "^0.20201231.0",
"web-streams-polyfill": "^3.1.1",
diff --git a/apps/web/src/components/navigation-menu/index.js b/apps/web/src/components/navigation-menu/index.js
index 04bb62e44..1de99f292 100644
--- a/apps/web/src/components/navigation-menu/index.js
+++ b/apps/web/src/components/navigation-menu/index.js
@@ -77,7 +77,7 @@ function NavigationMenu(props) {
const colors = useAppStore((store) => store.colors);
const pins = useAppStore((store) => store.menuPins);
const refreshMenuPins = useAppStore((store) => store.refreshMenuPins);
- const isSyncing = useAppStore((store) => store.isSyncing);
+ const isSyncing = useAppStore((store) => store.syncStatus === "syncing");
const isLoggedIn = useUserStore((store) => store.isLoggedIn);
const sync = useAppStore((store) => store.sync);
const theme = useThemeStore((store) => store.theme);
diff --git a/apps/web/src/stores/app-store.js b/apps/web/src/stores/app-store.js
index af1a56fb2..29475c7b9 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 { showToast } from "../utils/toast";
import { resetReminders } from "../common/reminders";
+var syncStatusTimeout = 0;
class AppStore extends BaseStore {
// default state
isSideMenuOpen = false;
@@ -140,6 +141,7 @@ class AppStore extends BaseStore {
};
sync = async (full = true, force = false) => {
+ clearTimeout(syncStatusTimeout);
this.updateLastSynced();
this.set((state) => (state.isSyncing = true));
@@ -165,9 +167,9 @@ class AppStore extends BaseStore {
}
})
.finally(() => {
- setTimeout(() => {
+ syncStatusTimeout = setTimeout(() => {
this.set((state) => (state.syncStatus = "synced"));
- }, 5000);
+ }, 3000);
});
};
}