From 985deb7f8b0ea84002d441db5fbd68da317a3c68 Mon Sep 17 00:00:00 2001 From: TheGeniusOfEternity Date: Sat, 8 Mar 2025 19:03:41 +0300 Subject: [PATCH 1/5] fix: added check on noteTitle's url patch Added check to prevent Note Settings page patch --- src/application/services/useNote.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/application/services/useNote.ts b/src/application/services/useNote.ts index 39995625..1d776660 100644 --- a/src/application/services/useNote.ts +++ b/src/application/services/useNote.ts @@ -322,12 +322,14 @@ export default function (options: UseNoteComposableOptions): UseNoteComposableSt }); watch(noteTitle, (currentNoteTitle) => { - patchOpenedPageByUrl( - route.path, - { - title: currentNoteTitle, - url: route.path, - }); + if (!route.path.includes('/settings')) { + patchOpenedPageByUrl( + route.path, + { + title: currentNoteTitle, + url: route.path, + }); + } }); return { From d08dc10f3bc113bb7b02b22f5a794d97698498c5 Mon Sep 17 00:00:00 2001 From: TheGeniusOfEternity Date: Sat, 8 Mar 2025 21:44:38 +0300 Subject: [PATCH 2/5] fix: unified check for multiple routes Now we shouldn't patch opened page if it's about note settings, note history or note error --- src/application/services/useNote.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/application/services/useNote.ts b/src/application/services/useNote.ts index 1d776660..ba728fda 100644 --- a/src/application/services/useNote.ts +++ b/src/application/services/useNote.ts @@ -322,7 +322,9 @@ export default function (options: UseNoteComposableOptions): UseNoteComposableSt }); watch(noteTitle, (currentNoteTitle) => { - if (!route.path.includes('/settings')) { + const routes = ['/settings', '/history', '/error']; + + if (routes.every(rt => !route.path.includes(rt))) { patchOpenedPageByUrl( route.path, { From 363939274594f9016de6bf0efb7b76968737dc36 Mon Sep 17 00:00:00 2001 From: TheGeniusOfEternity Date: Fri, 21 Mar 2025 11:16:16 +0300 Subject: [PATCH 3/5] fix: simplified route's path check --- src/application/services/useNote.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/application/services/useNote.ts b/src/application/services/useNote.ts index ba728fda..7e4037dd 100644 --- a/src/application/services/useNote.ts +++ b/src/application/services/useNote.ts @@ -322,9 +322,7 @@ export default function (options: UseNoteComposableOptions): UseNoteComposableSt }); watch(noteTitle, (currentNoteTitle) => { - const routes = ['/settings', '/history', '/error']; - - if (routes.every(rt => !route.path.includes(rt))) { + if (!route.path.match('/note/.{10}/')) { patchOpenedPageByUrl( route.path, { From b4163274490f4c5547cd7b2c0117102f159f5b8d Mon Sep 17 00:00:00 2001 From: TheGeniusOfEternity Date: Mon, 7 Apr 2025 22:51:43 +0300 Subject: [PATCH 4/5] fix(useNote): simplify note's tab override condition --- src/application/services/useNote.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/application/services/useNote.ts b/src/application/services/useNote.ts index 64a23b0c..68f05cae 100644 --- a/src/application/services/useNote.ts +++ b/src/application/services/useNote.ts @@ -379,7 +379,7 @@ export default function (options: UseNoteComposableOptions): UseNoteComposableSt }); watch(noteTitle, (currentNoteTitle) => { - if (!route.path.match('/note/.{10}/')) { + if (route.name == "note") { patchOpenedPageByUrl( route.path, { From 702dac9a55aba0012f8c99226e397bf597f76880 Mon Sep 17 00:00:00 2001 From: TheGeniusOfEternity Date: Mon, 7 Apr 2025 22:54:29 +0300 Subject: [PATCH 5/5] fix(eslint): singlequote --- src/application/services/useNote.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/application/services/useNote.ts b/src/application/services/useNote.ts index 68f05cae..4244020b 100644 --- a/src/application/services/useNote.ts +++ b/src/application/services/useNote.ts @@ -379,7 +379,7 @@ export default function (options: UseNoteComposableOptions): UseNoteComposableSt }); watch(noteTitle, (currentNoteTitle) => { - if (route.name == "note") { + if (route.name == 'note') { patchOpenedPageByUrl( route.path, {