Преглед изворни кода

Fixes #569 getScheduled returns two items

Sebastián Katzer пре 10 година
родитељ
комит
a1f7d2509c
2 измењених фајлова са 6 додато и 2 уклоњено
  1. 1 0
      CHANGELOG.md
  2. 5 2
      src/windows/LocalNotificationCore.js

+ 1 - 0
CHANGELOG.md

@@ -14,6 +14,7 @@ Please also read the [Upgrade Guide](https://github.com/katzer/cordova-plugin-lo
 - Fixed #682 crash while resuming app from notification (Android 6)
 - Fixed #612 cannot update icon or sound (Android)
 - Fixed crashing `get(ID)` if notification doesn't exist
+- Fixed #569 `getScheduled` returns two items per notification
 
 #### Version 0.8.2 (08.11.2015)
 - Submitted to npm

+ 5 - 2
src/windows/LocalNotificationCore.js

@@ -324,9 +324,12 @@ proxy.core = {
             ids = [];
 
         for (var i = 0; i < toasts.length; i++) {
-            var toast = toasts[i];
+            var toast   = toasts[i],
+                toastId = this.getToastId(toast);
 
-            ids.push(this.getToastId(toast));
+            if (ids.indexOf(toastId) == -1) {
+                ids.push(toastId);
+            }
         }
 
         return ids;