Merge pull request #296 from EdouardVanbelle/fix/music

This commit is contained in:
Dionisio Pozo
2026-04-15 06:01:56 +02:00
committed by GitHub
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;
+1 -1
View File
@@ -108,7 +108,7 @@ function initSidebarToggle() {
document.addEventListener('DOMContentLoaded', initSidebarToggle);
// Mapping of section names to their corresponding view flags
const VIEW_FLAGS = {
export const VIEW_FLAGS = {
files: 'isFilesView',
shared: 'isSharedView',
recent: 'isRecentView',