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
web: unlock view should use base theme scope
Abdullah Atta9d0c11b0513c
diff --git a/apps/web/src/app.tsx b/apps/web/src/app.tsxindex 465925b59..8c2bd6423 100644--- a/apps/web/src/app.tsx+++ b/apps/web/src/app.tsx@@ -202,15 +202,13 @@ function DesktopAppContents({bg: "background"}}>- <ScopedThemeProvider scope="editor" sx={{ flex: 1 }}>- {isAppLoaded && (- <SuspenseLoader- fallback={<EditorLoader />}- component={HashRouter}- condition={isAppLoaded}- />- )}- </ScopedThemeProvider>+ {isAppLoaded && (+ <SuspenseLoader+ fallback={<EditorLoader />}+ component={HashRouter}+ condition={isAppLoaded}+ />+ )}</Flex></Allotment.Pane></Allotment>diff --git a/apps/web/src/components/unlock/index.jsx b/apps/web/src/components/unlock/index.tsxsimilarity index 89%rename from apps/web/src/components/unlock/index.jsxrename to apps/web/src/components/unlock/index.tsxindex d0cde27e7..264e75873 100644--- a/apps/web/src/components/unlock/index.jsx+++ b/apps/web/src/components/unlock/index.tsx@@ -27,17 +27,20 @@ import Field from "../field";import { showToast } from "../../utils/toast";import { ErrorText } from "../error-text";-function Unlock(props) {+type UnlockProps = {+ noteId: string;+};+function Unlock(props: UnlockProps) {const { noteId } = props;const [isWrong, setIsWrong] = useState(false);const [isUnlocking, setIsUnlocking] = useState(false);const [isLoading, setIsLoading] = useState(true);- const passwordRef = useRef();+ const passwordRef = useRef<HTMLInputElement>();const note = useMemo(- () => !isLoading && db.notes.note(noteId)?.data,+ () => !isLoading && db.notes?.note(noteId)?.data,[noteId, isLoading]);const openLockedSession = useEditorStore((store) => store.openLockedSession);@@ -45,14 +48,18 @@ function Unlock(props) {const setIsEditorOpen = useAppStore((store) => store.setIsEditorOpen);const submit = useCallback(async () => {+ if (!passwordRef.current) return;setIsUnlocking(true);const password = passwordRef.current.value;try {if (!password) return;- const note = await db.vault.open(noteId, password);+ const note = await db.vault?.open(noteId, password);openLockedSession(note);} catch (e) {- if (e.message.includes("ciphertext cannot be decrypted using that key")) {+ if (+ e instanceof Error &&+ e.message.includes("ciphertext cannot be decrypted using that key")+ ) {setIsWrong(true);} else {showToast("error", "Cannot unlock note: " + e);@@ -122,7 +129,7 @@ function Unlock(props) {sx={{ width: ["95%", "95%", "30%"] }}placeholder="Enter password"type="password"- onKeyUp={async (e) => {+ onKeyUp={async (e: KeyboardEvent) => {if (e.key === "Enter") {await submit();} else if (isWrong) {