Full operation when localStorage absent, fixes #206

This commit is contained in:
James Barnsley
2017-11-23 21:15:35 +13:00
parent 668f8c9d28
commit 09ad29c853
10 changed files with 388 additions and 368 deletions

View File

@ -4315,6 +4315,9 @@ aside {
.list.artist-list .list-item .col.followers_total, .list.artist-list .list-item .col.popularity {
width: 15%; }
.list.queue-track-list .list-item .liner {
padding-right: 60px; }
.list.queue-track-list .col.name, .list.queue-track-list .col.artists, .list.queue-track-list .col.album {
width: 25% !important; }

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -4315,6 +4315,9 @@ aside {
.list.artist-list .list-item .col.followers_total, .list.artist-list .list-item .col.popularity {
width: 15%; }
.list.queue-track-list .list-item .liner {
padding-right: 60px; }
.list.queue-track-list .col.name, .list.queue-track-list .col.artists, .list.queue-track-list .col.album {
width: 25% !important; }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -38,7 +38,7 @@
// Release details
// These are automatically injected by build.sh
var build = "1511291369";
var build = "1511424389";
var version = "3.8.5";
// Construct the script tag
@ -50,8 +50,13 @@
css.rel = "stylesheet";
// Check for test mode. This is toggled under Settings > Debug > Test mode
var ui = JSON.parse(localStorage.getItem('ui') );
var test_mode = (typeof(ui) !== 'undefined' && ui && typeof(ui.test_mode) !== 'undefined' && ui.test_mode);
try {
var ui = JSON.parse(localStorage.getItem('ui') );
var test_mode = (typeof(ui) !== 'undefined' && ui && typeof(ui.test_mode) !== 'undefined' && ui.test_mode);
} catch(error){
console.error(error);
var test_mode = false;
}
// Test mode, use built (but not minified) code
if (test_mode){

View File

@ -50,8 +50,13 @@
css.rel = "stylesheet";
// Check for test mode. This is toggled under Settings > Debug > Test mode
var ui = JSON.parse(localStorage.getItem('ui') );
var test_mode = (typeof(ui) !== 'undefined' && ui && typeof(ui.test_mode) !== 'undefined' && ui.test_mode);
try {
var ui = JSON.parse(localStorage.getItem('ui') );
var test_mode = (typeof(ui) !== 'undefined' && ui && typeof(ui.test_mode) !== 'undefined' && ui.test_mode);
} catch(error){
console.error(error);
var test_mode = false;
}
// Test mode, use built (but not minified) code
if (test_mode){

2
src/js/bootstrap.js vendored
View File

@ -1,6 +1,8 @@
import { createStore, applyMiddleware, combineReducers } from 'redux'
import * as helpers from './helpers'
import core from './services/core/reducer'
import ui from './services/ui/reducer'
import pusher from './services/pusher/reducer'

View File

@ -32,7 +32,7 @@ export let getStorage = function(key, default_value = {}){
}
} else {
alert("Local storage not available");
console.warn("localStorage not available. Using default value for '"+key+"'.");
return default_value;
}
}
@ -51,7 +51,7 @@ export let setStorage = function(key, value){
}
storage.setItem(key, JSON.stringify(new_value));
} else {
alert("Local storage not available");
console.warn("localStorage not available. '"+key+"'' will not perist when you close your browser.");
return false;
}
}