Timothy Jaeryang Baek 4 месяцев назад
Родитель
Сommit
23ea754061

+ 1 - 1
src/lib/components/layout/SearchModal.svelte

@@ -233,7 +233,7 @@
 						{
 							label: $i18n.t('Create a new note'),
 							onClick: async () => {
-								await goto(`/notes${query ? `?content=${query}` : ''}`);
+								await goto(`/notes?content=${query}`);
 								show = false;
 								onClose();
 							},

+ 3 - 5
src/lib/components/notes/Notes.svelte

@@ -303,12 +303,10 @@
 	});
 
 	onMount(async () => {
-		if ($page.url.searchParams.get('content')) {
+		if ($page.url.searchParams.get('content') !== null) {
 			const content = $page.url.searchParams.get('content') ?? '';
-			if (content) {
-				createNoteHandler(content);
-				return;
-			}
+			createNoteHandler(content);
+			return;
 		}
 
 		await init();