mirror of
https://github.com/standardnotes/mobile.git
synced 2026-04-19 05:39:20 -04:00
Theme URL check
This commit is contained in:
@@ -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);
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -66,8 +66,6 @@ export default class Sync {
|
||||
|
||||
this.dataLoaded = true;
|
||||
|
||||
console.log("Sync: Local Data Loaded");
|
||||
|
||||
this.dataLoadObservers.forEach(function(observer){
|
||||
observer.callback();
|
||||
})
|
||||
|
||||
@@ -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});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user