From 43f977e8248d8353f6592f9d7c39a9fd2f60ce62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Fri, 29 Jun 2012 17:08:27 +0200 Subject: [PATCH] Only ask for permissions if we don't already have them --- file/js/be.bastelstu.WCF.Chat.coffee | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/file/js/be.bastelstu.WCF.Chat.coffee b/file/js/be.bastelstu.WCF.Chat.coffee index 1763472..d4dc64e 100644 --- a/file/js/be.bastelstu.WCF.Chat.coffee +++ b/file/js/be.bastelstu.WCF.Chat.coffee @@ -192,8 +192,9 @@ window.console ?= # Desktop Notifications unless typeof window.webkitNotifications is 'undefined' $('#timsChatNotify').click (event) -> - window.webkitNotifications.requestPermission() if $(@).data 'status' - + if $(@).data 'status' and window.webkitNotifications.checkPermission() isnt 0 + window.webkitNotifications.requestPermission() + ### # Changes the chat-room. #