Don't use syncadaptors until they are ready

Fixes #2453
This commit is contained in:
Jermolene
2016-07-05 11:29:59 +01:00
parent ff57b4084a
commit c3d18364c1
3 changed files with 13 additions and 2 deletions

View File

@@ -19,9 +19,14 @@ function TiddlyWebAdaptor(options) {
this.wiki = options.wiki;
this.host = this.getHost();
this.recipe = undefined;
this.hasStatus = false;
this.logger = new $tw.utils.Logger("TiddlyWebAdaptor");
}
TiddlyWebAdaptor.prototype.isReady = function() {
return this.hasStatus;
};
TiddlyWebAdaptor.prototype.getHost = function() {
var text = this.wiki.getTiddlerText(CONFIG_HOST_TIDDLER,DEFAULT_HOST_TIDDLER),
substitutions = [
@@ -51,6 +56,7 @@ TiddlyWebAdaptor.prototype.getStatus = function(callback) {
$tw.utils.httpRequest({
url: this.host + "status",
callback: function(err,data) {
self.hasStatus = true;
if(err) {
return callback(err);
}