浏览代码

Implement update on windows

Sebastián Katzer 10 年之前
父节点
当前提交
40187ef1b4
共有 1 个文件被更改,包括 17 次插入12 次删除
  1. 17 12
      src/windows/LocalNotificationCore.js

+ 17 - 12
src/windows/LocalNotificationCore.js

@@ -146,18 +146,6 @@ exports.core = {
             .update(notification);
             .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.
      * 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.
      * Clears the specified notifications.
      *
      *