Merge pull request #296 from EdouardVanbelle/fix/music
This commit is contained in:
@@ -21,7 +21,8 @@ import {
|
|||||||
switchToPhotosSection,
|
switchToPhotosSection,
|
||||||
switchToRecentFilesSection,
|
switchToRecentFilesSection,
|
||||||
switchToSharedSection,
|
switchToSharedSection,
|
||||||
switchToTrashSection
|
switchToTrashSection,
|
||||||
|
VIEW_FLAGS
|
||||||
} from './navigation.js';
|
} from './navigation.js';
|
||||||
import { performSearch } from './searchView.js';
|
import { performSearch } from './searchView.js';
|
||||||
import { app, appElements as elements } from './state.js';
|
import { app, appElements as elements } from './state.js';
|
||||||
@@ -246,8 +247,7 @@ function deserializeHash() {
|
|||||||
|
|
||||||
const section = hash_elements[1];
|
const section = hash_elements[1];
|
||||||
|
|
||||||
// FIXME: use navigation.VIEW_FLAGS
|
if (section in VIEW_FLAGS) {
|
||||||
if (section && ['files', 'shared', 'recent', 'favorites', 'trash', 'photos'].includes(section)) {
|
|
||||||
hashContext.section = section;
|
hashContext.section = section;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -306,6 +306,7 @@ function switchSectionTo(section) {
|
|||||||
// no change ...
|
// no change ...
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
//TODO: better to use a registry for the future (easier to add new section)
|
||||||
switch (section) {
|
switch (section) {
|
||||||
case 'files':
|
case 'files':
|
||||||
switchToFilesSection();
|
switchToFilesSection();
|
||||||
@@ -327,6 +328,10 @@ function switchSectionTo(section) {
|
|||||||
switchToPhotosSection();
|
switchToPhotosSection();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'music':
|
||||||
|
switchToMusicSection();
|
||||||
|
break;
|
||||||
|
|
||||||
case 'trash':
|
case 'trash':
|
||||||
switchToTrashSection();
|
switchToTrashSection();
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ function initSidebarToggle() {
|
|||||||
document.addEventListener('DOMContentLoaded', initSidebarToggle);
|
document.addEventListener('DOMContentLoaded', initSidebarToggle);
|
||||||
|
|
||||||
// Mapping of section names to their corresponding view flags
|
// Mapping of section names to their corresponding view flags
|
||||||
const VIEW_FLAGS = {
|
export const VIEW_FLAGS = {
|
||||||
files: 'isFilesView',
|
files: 'isFilesView',
|
||||||
shared: 'isSharedView',
|
shared: 'isSharedView',
|
||||||
recent: 'isRecentView',
|
recent: 'isRecentView',
|
||||||
|
|||||||
Reference in New Issue
Block a user