diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2020-03-22 22:58:18 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2020-03-22 22:58:18 -0700 |
commit | ba9cc86f667486a09edb323402c2d63ada5ea639 (patch) | |
tree | 8df80eca54f9dd39664f63365ffcc2ec248fb3df /web/app/Application.js | |
parent | 990d485a21c945e7d57b85378650a65f3e79eed3 (diff) | |
parent | f5165c8e897e8d9cf4219d943e2d34b61adb48b5 (diff) | |
download | trackermap-web-ba9cc86f667486a09edb323402c2d63ada5ea639.tar.gz trackermap-web-ba9cc86f667486a09edb323402c2d63ada5ea639.tar.bz2 trackermap-web-ba9cc86f667486a09edb323402c2d63ada5ea639.zip |
Merge branch 'master' into modern
Diffstat (limited to 'web/app/Application.js')
-rw-r--r-- | web/app/Application.js | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/web/app/Application.js b/web/app/Application.js index d0b6713c..91bdc584 100644 --- a/web/app/Application.js +++ b/web/app/Application.js @@ -21,7 +21,8 @@ Ext.define('Traccar.Application', { requires: [ 'Traccar.Style', - 'Traccar.AttributeFormatter' + 'Traccar.AttributeFormatter', + 'Traccar.view.TouchFix62' ], models: [ @@ -51,6 +52,7 @@ Ext.define('Traccar.Application', { 'Devices', 'AllGroups', 'AllDevices', + 'AlarmTypes', 'Positions', 'LatestPositions', 'EventPositions', @@ -148,6 +150,19 @@ Ext.define('Traccar.Application', { } }, + updateNotificationToken: function (token) { + var attributes = Ext.clone(this.user.get('attributes')); + if (!attributes.notificationTokens || attributes.notificationTokens.indexOf(token) < 0) { + if (!attributes.notificationTokens) { + attributes.notificationTokens = token; + } else { + attributes.notificationTokens += ',' + token; + } + this.user.set('attributes', attributes); + this.user.save(); + } + }, + setUser: function (data) { var reader = Ext.create('Ext.data.reader.Json', { model: 'Traccar.model.User' |