aboutsummaryrefslogtreecommitdiff
path: root/web/app
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-06-28 09:12:45 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-06-28 09:12:45 +1200
commitea0a523ef676310526055b1ae381387868afd738 (patch)
tree156a7afe87292bbc85cada6509ec6831ff246695 /web/app
parent51169169b4f34fe23cbcd0c26d46815ba9292e60 (diff)
downloadtraccar-server-ea0a523ef676310526055b1ae381387868afd738.tar.gz
traccar-server-ea0a523ef676310526055b1ae381387868afd738.tar.bz2
traccar-server-ea0a523ef676310526055b1ae381387868afd738.zip
Fix state info duplicates (fix #1277)
Diffstat (limited to 'web/app')
-rw-r--r--web/app/view/state/StateController.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/web/app/view/state/StateController.js b/web/app/view/state/StateController.js
index f87a89664..466b0ee5b 100644
--- a/web/app/view/state/StateController.js
+++ b/web/app/view/state/StateController.js
@@ -72,6 +72,7 @@ Ext.define('Traccar.view.state.StateController', {
updatePosition: function(position) {
var store = Ext.getStore('Parameters');
+ store.removeAll();
for (var key in position.data) {
if (position.data.hasOwnProperty(key) && this.keys[key] !== undefined) {
@@ -101,9 +102,10 @@ Ext.define('Traccar.view.state.StateController', {
selectDevice: function(device) {
this.deviceId = device.get('id');
var found = Ext.getStore('LiveData').query('deviceId', this.deviceId);
- Ext.getStore('Parameters').removeAll();
if (found.getCount() > 0) {
this.updatePosition(found.first());
+ } else {
+ Ext.getStore('Parameters').removeAll();
}
},