aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-04-19 06:49:10 -0700
committerAnton Tananaev <anton@traccar.org>2023-04-19 06:49:10 -0700
commitbddaa24cfc1f2cfb0ce66c938528faff6c846806 (patch)
treed02bf76502d4a6bdb46f7d65cd26fe4b50e12505
parentfc788646bc720d3cceb639db83094d8540025d3b (diff)
downloadtrackermap-web-bddaa24cfc1f2cfb0ce66c938528faff6c846806.tar.gz
trackermap-web-bddaa24cfc1f2cfb0ce66c938528faff6c846806.tar.bz2
trackermap-web-bddaa24cfc1f2cfb0ce66c938528faff6c846806.zip
Readonly notification token
-rw-r--r--modern/src/common/components/BottomMenu.js2
-rw-r--r--modern/src/common/components/NativeInterface.js2
2 files changed, 2 insertions, 2 deletions
diff --git a/modern/src/common/components/BottomMenu.js b/modern/src/common/components/BottomMenu.js
index cb9e34e1..07fa2e11 100644
--- a/modern/src/common/components/BottomMenu.js
+++ b/modern/src/common/components/BottomMenu.js
@@ -51,7 +51,7 @@ const BottomMenu = () => {
setAnchorEl(null);
const notificationToken = window.localStorage.getItem('notificationToken');
- if (notificationToken) {
+ if (notificationToken && !user.readonly) {
window.localStorage.removeItem('notificationToken');
const tokens = user.attributes.notificationTokens?.split(',') || [];
if (tokens.includes(notificationToken)) {
diff --git a/modern/src/common/components/NativeInterface.js b/modern/src/common/components/NativeInterface.js
index d43b678c..b088de0e 100644
--- a/modern/src/common/components/NativeInterface.js
+++ b/modern/src/common/components/NativeInterface.js
@@ -37,7 +37,7 @@ const NativeInterface = () => {
}, [setNotificationToken]);
useEffectAsync(async () => {
- if (user && notificationToken) {
+ if (user && !user.readonly && notificationToken) {
window.localStorage.setItem('notificationToken', notificationToken);
setNotificationToken(null);