aboutsummaryrefslogtreecommitdiff
path: root/modern/src/SocketController.js
diff options
context:
space:
mode:
authorDesmond Kyeremeh <elDekyfin@gmail.com>2021-07-11 23:39:30 +0000
committerDesmond Kyeremeh <elDekyfin@gmail.com>2021-07-11 23:39:30 +0000
commit004367fc1fd389b169821eb2d73266490f409999 (patch)
tree1b7e6f13c03326a957bdb78351853f429156b3ae /modern/src/SocketController.js
parent1b93de84e2bf6a6532bdb03e1ae75e47061a4dca (diff)
parent702e674ecce7de1a4f4318ef8f30c572264a4560 (diff)
downloadetbsa-traccar-web-004367fc1fd389b169821eb2d73266490f409999.tar.gz
etbsa-traccar-web-004367fc1fd389b169821eb2d73266490f409999.tar.bz2
etbsa-traccar-web-004367fc1fd389b169821eb2d73266490f409999.zip
Merge remote-tracking branch 'upstream/master' into group-config
Diffstat (limited to 'modern/src/SocketController.js')
-rw-r--r--modern/src/SocketController.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/modern/src/SocketController.js b/modern/src/SocketController.js
index 901f506..ae82d13 100644
--- a/modern/src/SocketController.js
+++ b/modern/src/SocketController.js
@@ -7,10 +7,10 @@ import { useEffectAsync } from './reactHelper';
const displayNotifications = (events) => {
if ('Notification' in window) {
if (Notification.permission === 'granted') {
- for (const event of events) {
+ events.forEach((event) => {
const notification = new Notification(`Event: ${event.type}`);
setTimeout(notification.close.bind(notification), 4 * 1000);
- }
+ });
} else if (Notification.permission !== 'denied') {
Notification.requestPermission((permission) => {
if (permission === 'granted') {