Skip to content

Commit bc964d7

Browse files
committed
refactor: Improve readability & explanation of routing back in fileHandler
1 parent 8a7bc61 commit bc964d7

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

client/src/router/navigation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export async function navigateToWorkspace(
5252

5353
export async function routerGoBack(): Promise<void> {
5454
const router = getRouter();
55-
router.go(-1);
55+
router.back();
5656
}
5757

5858
const routesBackup: Array<RouteBackup> = [];

client/src/views/files/handler/FileHandler.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,10 @@ async function showDetails(): Promise<void> {
668668
}
669669
670670
async function openEditor(path: FsPath): Promise<void> {
671+
// Here we want to ensure the router goes back to documents page
672+
// before opening the editor for routing purposes (history stack)
673+
// Could probably be improved with better routing management
674+
// maybe avoiding routing between viewer and editor by loading components directly
671675
await routerGoBack();
672676
const workspaceHandle = getWorkspaceHandle();
673677
if (workspaceHandle) {

0 commit comments

Comments
 (0)