Theme URL check

This commit is contained in:
Mo Bitar
2017-10-07 10:34:02 -05:00
parent 66ab9e0656
commit f7c7563f5e
3 changed files with 18 additions and 14 deletions

View File

@@ -153,7 +153,24 @@ export default class GlobalStyles {
}
async downloadTheme(theme, callback) {
let errorBlock = (error) => {
if(!theme.notAvailableOnMobile) {
theme.notAvailableOnMobile = true;
theme.setDirty(true);
}
callback && callback();
console.error("Theme download error", error);
}
if(!theme.url) {
errorBlock(null);
return;
}
var url;
if(theme.url.includes("?")) {
url = theme.url.replace("?", ".json?");
} else {
@@ -180,16 +197,7 @@ export default class GlobalStyles {
callback();
}
}, function(response) {
// error
if(!theme.notAvailableOnMobile) {
theme.notAvailableOnMobile = true;
theme.setDirty(true);
}
if(callback) {
callback();
}
console.log("Theme download error", response);
errorBlock(response);
})
}

View File

@@ -66,8 +66,6 @@ export default class Sync {
this.dataLoaded = true;
console.log("Sync: Local Data Loaded");
this.dataLoadObservers.forEach(function(observer){
observer.callback();
})

View File

@@ -31,7 +31,6 @@ export default class Abstract extends Component {
}
lockContent() {
console.log("Locking Content");
this.mergeState({lockContent: true});
this.configureNavBar();
}
@@ -40,7 +39,6 @@ export default class Abstract extends Component {
if(!this.loadedInitialState) {
this.loadInitialState();
}
console.log("Unlocking Content");
this.mergeState({lockContent: false});
}