fix(main.js): add missing break in swithc/case + apply linter
This commit is contained in:
@@ -3,8 +3,6 @@
|
||||
* This file contains the core functionality, initialization and state management
|
||||
*/
|
||||
|
||||
// @ts-check
|
||||
|
||||
const app = window.app;
|
||||
const elements = window.appElements;
|
||||
|
||||
@@ -217,21 +215,21 @@ function setupActionsBarDelegation() {
|
||||
* @returns {OxiContext}
|
||||
*/
|
||||
function deserializeHash() {
|
||||
let hashContext = /** type {OxiContext} */ {};
|
||||
const hashContext = /** type {OxiContext} */ {};
|
||||
|
||||
// FIXME rename files into drive ?
|
||||
hashContext.section = 'files';
|
||||
|
||||
let hash_elements = window.location.hash.split("/");
|
||||
const hash_elements = window.location.hash.split("/");
|
||||
|
||||
let section = hash_elements[1];
|
||||
const section = hash_elements[1];
|
||||
|
||||
// FIXME: use navigation.VIEW_FLAGS
|
||||
if (section && ['files', 'shared', 'recent', 'favorites', 'trash', 'photos'].includes(section)) {
|
||||
hashContext.section = section;
|
||||
}
|
||||
|
||||
if (hash_elements[1] == 'files' && hash_elements[2] == 'folder' && hash_elements[3] !== null) {
|
||||
if (hash_elements[1] === 'files' && hash_elements[2] === 'folder' && hash_elements[3] !== null) {
|
||||
hashContext.path = hash_elements[3];
|
||||
|
||||
if (hash_elements[4] == 'file' && hash_elements[5] !== null) {
|
||||
@@ -277,8 +275,6 @@ function updateHistory( insertHistory) {
|
||||
console.log(`replace history with ${historyUrl}`)
|
||||
window.history.replaceState(historyData, "", historyUrl);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -295,6 +291,7 @@ function switchSectionTo(section) {
|
||||
switch (section) {
|
||||
case "files":
|
||||
switchToFilesSection();
|
||||
break;
|
||||
|
||||
case "shared":
|
||||
switchToSharedSection();
|
||||
|
||||
Reference in New Issue
Block a user