fix(navigation): correct hash url and navigation to music

This commit is contained in:
Edouard Vanbelle
2026-04-15 00:39:14 +02:00
parent 761d159a92
commit 0b27c3b400
2 changed files with 9 additions and 4 deletions
+8 -3
View File
@@ -21,7 +21,8 @@ import {
switchToPhotosSection,
switchToRecentFilesSection,
switchToSharedSection,
switchToTrashSection
switchToTrashSection,
VIEW_FLAGS
} from './navigation.js';
import { performSearch } from './searchView.js';
import { app, appElements as elements } from './state.js';
@@ -246,8 +247,7 @@ function deserializeHash() {
const section = hash_elements[1];
// FIXME: use navigation.VIEW_FLAGS
if (section && ['files', 'shared', 'recent', 'favorites', 'trash', 'photos'].includes(section)) {
if (section in VIEW_FLAGS) {
hashContext.section = section;
}
@@ -306,6 +306,7 @@ function switchSectionTo(section) {
// no change ...
return;
//TODO: better to use a registry for the future (easier to add new section)
switch (section) {
case 'files':
switchToFilesSection();
@@ -327,6 +328,10 @@ function switchSectionTo(section) {
switchToPhotosSection();
break;
case 'music':
switchToMusicSection();
break;
case 'trash':
switchToTrashSection();
break;