aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2022-02-07 20:43:34 -0800
committerAnton Tananaev <anton.tananaev@gmail.com>2022-02-07 20:43:41 -0800
commit227971b2d28c8005ebf2ea3b8a135687a8ae0a17 (patch)
tree39bcf15a311f07663ed66a742061c8ce7220df81
parent83ba41f26e99f8e42a18ec0a96a7902ca459b5d7 (diff)
downloadtrackermap-web-227971b2d28c8005ebf2ea3b8a135687a8ae0a17.tar.gz
trackermap-web-227971b2d28c8005ebf2ea3b8a135687a8ae0a17.tar.bz2
trackermap-web-227971b2d28c8005ebf2ea3b8a135687a8ae0a17.zip
Select device based on uniqueId
-rw-r--r--web/app/controller/Root.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/web/app/controller/Root.js b/web/app/controller/Root.js
index 65b56fa6..a37bc06f 100644
--- a/web/app/controller/Root.js
+++ b/web/app/controller/Root.js
@@ -1,5 +1,5 @@
/*
- * Copyright 2015 - 2017 Anton Tananaev (anton@traccar.org)
+ * Copyright 2015 - 2022 Anton Tananaev (anton@traccar.org)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -308,7 +308,7 @@ Ext.define('Traccar.controller.Root', {
},
updatePositions: function (array, first) {
- var i, store, entity, deviceId, device;
+ var i, store, entity, uniqueId, device;
store = Ext.getStore('LatestPositions');
for (i = 0; i < array.length; i++) {
entity = store.findRecord('deviceId', array[i].deviceId, 0, false, false, true);
@@ -322,9 +322,9 @@ Ext.define('Traccar.controller.Root', {
}
}
if (first) {
- deviceId = Ext.Object.fromQueryString(window.location.search).deviceId;
- if (deviceId) {
- device = Ext.getStore('VisibleDevices').findRecord('id', deviceId, 0, false, true, true);
+ uniqueId = Ext.Object.fromQueryString(window.location.search).deviceId;
+ if (uniqueId) {
+ device = Ext.getStore('VisibleDevices').findRecord('uniqueId', uniqueId, 0, false, true, true);
if (device) {
this.fireEvent('selectdevice', device, true);
}