Browse Source

Implement update on windows

Sebastián Katzer 10 years ago
parent
commit
40187ef1b4
1 changed files with 17 additions and 12 deletions
  1. 17 12
      src/windows/LocalNotificationCore.js

+ 17 - 12
src/windows/LocalNotificationCore.js

@@ -146,18 +146,6 @@ exports.core = {
             .update(notification);
     },
 
-    /**
-     * Updates a single local notification.
-     *
-     * @param {Object} notification
-     *      The local notification
-     * @param {Object} updates
-     *      Updated properties
-     */
-    updateLocalNotification: function (notification, updates) {
-
-    },
-
     /**
      * Updates existing notifications specified by IDs in options.
      *
@@ -174,6 +162,23 @@ exports.core = {
         }
     },
 
+    /**
+     * Updates a single local notification.
+     *
+     * @param {Object} notification
+     *      The local notification
+     * @param {Object} updates
+     *      Updated properties
+     */
+    updateLocalNotification: function (notification, updates) {
+        for (var key in updates) {
+            notification[key] = updates[key];
+        }
+
+        this.cancelLocalNotification(notification.id);
+        this.scheduleLocalNotification(notification);
+    },
+
     /**
      * Clears the specified notifications.
      *