Merge pull request #364 from humphd/thimble-issue590-followup

Don't warn if theme or preview mode are null
This commit is contained in:
David Humphrey 2015-06-24 11:30:35 -04:00
Родитель f579baf07e f3473a3d7a
Коммит 82433a0fd0
1 изменённых файлов: 20 добавлений и 16 удалений

Просмотреть файл

@ -65,25 +65,29 @@ define(function (require, exports, module) {
*/
function restoreState() {
var theme = BrambleStartupState.ui("theme");
switch(theme) {
case "light-theme":
case "dark-theme":
Theme.setTheme(theme);
break;
default:
console.warn("[Bramble] unknown theme: `" + theme + "`");
if(theme) {
switch(theme) {
case "light-theme":
case "dark-theme":
Theme.setTheme(theme);
break;
default:
console.warn("[Bramble] unknown theme: `" + theme + "`");
}
}
var previewMode = BrambleStartupState.ui("previewMode");
switch(previewMode) {
case "desktop":
showDesktopView();
break;
case "mobile":
showMobileView();
break;
default:
console.warn("[Bramble] unknown preview mode: `" + previewMode + "`");
if(previewMode) {
switch(previewMode) {
case "desktop":
showDesktopView();
break;
case "mobile":
showMobileView();
break;
default:
console.warn("[Bramble] unknown preview mode: `" + previewMode + "`");
}
}
var sidebarWidth = BrambleStartupState.ui("sidebarWidth");