diff options
Diffstat (limited to 'web')
-rw-r--r-- | web/app/Application.js | 8 | ||||
-rw-r--r-- | web/app/AttributeFormatter.js | 1 | ||||
-rw-r--r-- | web/app/LoginManager.js | 5 |
3 files changed, 6 insertions, 8 deletions
diff --git a/web/app/Application.js b/web/app/Application.js index 1a9326dd1..67dc96536 100644 --- a/web/app/Application.js +++ b/web/app/Application.js @@ -62,8 +62,11 @@ Ext.define('Traccar.Application', { return this.user; }, - setServer: function(server) { - this.server = server; + setServer: function(data) { + var reader = Ext.create('Ext.data.reader.Json', { + model: 'Traccar.model.Server' + }); + this.server = reader.readRecords(data).getRecords()[0]; }, getServer: function() { @@ -73,5 +76,4 @@ Ext.define('Traccar.Application', { getPreference: function(key, defaultValue) { return this.getUser().get(key) || this.getServer().get(key) || defaultValue; } - }); diff --git a/web/app/AttributeFormatter.js b/web/app/AttributeFormatter.js index ba77c2072..2e61dd8c2 100644 --- a/web/app/AttributeFormatter.js +++ b/web/app/AttributeFormatter.js @@ -58,5 +58,4 @@ Ext.define('Traccar.AttributeFormatter', { return this.defaultFormatter; } } - }); diff --git a/web/app/LoginManager.js b/web/app/LoginManager.js index 0137ccf9c..867b4a7ab 100644 --- a/web/app/LoginManager.js +++ b/web/app/LoginManager.js @@ -31,10 +31,7 @@ Ext.define('Traccar.LoginManager', { if (Traccar.ErrorManager.check(success, response)) { var result = Ext.decode(response.responseText); if (result.success) { - var reader = Ext.create('Ext.data.reader.Json', { - model: 'Traccar.model.Server' - }); - Traccar.app.setServer(reader.readRecords(result.data).getRecords()[0]); + Traccar.app.setServer(result.data); } Ext.callback(options.callback, options.scope, [result.success]); } |