From dab678f7c502acc126b9956529deb21223546a9c Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Thu, 8 Aug 2024 13:51:33 +0200 Subject: [WIP] Make router interface reactive while being framework agnostic Currently it is only reactive when used within the files app, because the files app can access the vue router directly, problem is when other apps use it, then it is not reactive anymore as they have a different Vue. Also if you do not use Vue but vanilla JS or something else, the router params and query would not be reactive. Problem that this is solving: React to route changes only, watching current view and query will trigger on different time frames causing invalid states. e.g. changing the view from A to B and the query from `/foo` to `/` will cause: 1. View change 2. query change But after 1 the query is invalid and cause issues. So this changes will allow listening the route change which is combined 1 & 2 -> valid state. Signed-off-by: Ferdinand Thiessen --- apps/files/src/components/FilesListVirtual.vue | 20 +++++++++++--- apps/files/src/services/RouterService.ts | 37 ++++++++++++++++++++++++-- apps/files/src/views/FilesList.vue | 4 +-- 3 files changed, 54 insertions(+), 7 deletions(-) (limited to 'apps/files/src') diff --git a/apps/files/src/components/FilesListVirtual.vue b/apps/files/src/components/FilesListVirtual.vue index 9a35e9ff855..782e2bd3587 100644 --- a/apps/files/src/components/FilesListVirtual.vue +++ b/apps/files/src/components/FilesListVirtual.vue @@ -4,7 +4,7 @@ -->