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
mobile: fix state not updated on reminder change
ammarahm-ed646dbfef6e6f
diff --git a/apps/mobile/app/components/list-items/selection-wrapper/action-strip.js b/apps/mobile/app/components/list-items/selection-wrapper/action-strip.jsindex 71fde4e1f..fe147fb08 100644--- a/apps/mobile/app/components/list-items/selection-wrapper/action-strip.js+++ b/apps/mobile/app/components/list-items/selection-wrapper/action-strip.js@@ -26,6 +26,7 @@ import { openVault, ToastEvent } from "../../../services/event-manager";import Navigation from "../../../services/navigation";import { useMenuStore } from "../../../stores/use-menu-store";import { useNotebookStore } from "../../../stores/use-notebook-store";+import { useRelationStore } from "../../../stores/use-relation-store";import { useSelectionStore } from "../../../stores/use-selection-store";import { useThemeStore } from "../../../stores/use-theme-store";import { useTrashStore } from "../../../stores/use-trash-store";@@ -100,7 +101,6 @@ export const ActionStrip = ({ note, setActionStrip }) => {? "Remove Shortcut from Menu": "Add Shortcut to Menu",icon: isPinnedToMenu ? "link-variant-remove" : "link-variant",- visible: note.type !== "reminder",onPress: async () => {try {if (isPinnedToMenu) {@@ -139,7 +139,7 @@ export const ActionStrip = ({ note, setActionStrip }) => {console.error(e);}},- visible: note.type !== "note"+ visible: note.type !== "note" && note.type !== "reminder"},{title: "Copy Note",@@ -233,6 +233,7 @@ export const ActionStrip = ({ note, setActionStrip }) => {await db.reminders.remove(note.id);routes.push("Reminders");Navigation.queueRoutesForUpdate(...routes);+ useRelationStore.getState().update();},positiveText: "Delete",positiveType: "errorShade"diff --git a/apps/mobile/app/components/selection-header/index.js b/apps/mobile/app/components/selection-header/index.jsindex 789e1b51a..0dd794d3f 100644--- a/apps/mobile/app/components/selection-header/index.js+++ b/apps/mobile/app/components/selection-header/index.js@@ -225,7 +225,8 @@ export const SelectionHeader = React.memo(() => {{screen === "Trash" ||screen === "Notebooks" ||- screen === "Notebook" ? null : (+ screen === "Notebook" ||+ screen === "Reminders" ? null : (<><IconButtononPress={async () => {diff --git a/apps/mobile/app/components/sheets/relations-list/index.tsx b/apps/mobile/app/components/sheets/relations-list/index.tsxindex 6f21beecd..f6b31b0cb 100644--- a/apps/mobile/app/components/sheets/relations-list/index.tsx+++ b/apps/mobile/app/components/sheets/relations-list/index.tsx@@ -71,7 +71,7 @@ export const RelationsList = ({button,onAdd}: RelationsListProps) => {- const relations = useRelationStore();+ const updater = useRelationStore((state) => state.updater);const [items, setItems] = useState<Reminder[]>([]);const colors = useThemeStore((state) => state.colors);const hasNoRelations = !items || items.length === 0;@@ -83,7 +83,7 @@ export const RelationsList = ({referenceType) as any);- }, [item?.id, item?.type, referenceType, relationType, relations.updater]);+ }, [item?.id, item?.type, referenceType, relationType, updater]);return (<Viewstyle={{ paddingHorizontal: 12, height: hasNoRelations ? 300 : "100%" }}diff --git a/apps/mobile/app/hooks/use-actions.js b/apps/mobile/app/hooks/use-actions.jsindex 1fb5b8a92..37df9fb96 100644--- a/apps/mobile/app/hooks/use-actions.js+++ b/apps/mobile/app/hooks/use-actions.js@@ -465,6 +465,7 @@ export const useActions = ({ close = () => null, item }) => {routes.push("Tags");}Navigation.queueRoutesForUpdate(...routes);+ useRelationStore.getState().update();},positiveText: "Delete",positiveType: "errorShade"