Ver código fonte

Fix JS bug when trigger property was a date and no object

Sebastián Katzer 8 anos atrás
pai
commit
16de6fea2d
1 arquivos alterados com 2 adições e 9 exclusões
  1. 2 9
      www/local-notification-util.js

+ 2 - 9
www/local-notification-util.js

@@ -201,7 +201,8 @@ exports.convertTrigger = function (options) {
     var isCal = trigger.type == 'calendar';
 
     if (isCal && !date) {
-        date = this.getValueFor(options, 'at', 'firstAt', 'date') || new Date();
+        date = this.getValueFor(options, 'trigger', 'at', 'firstAt', 'date');
+        date = date || new Date();
     }
 
     if (isCal) {
@@ -213,14 +214,6 @@ exports.convertTrigger = function (options) {
         trigger.every = options.every;
     }
 
-    if (!trigger.count && device.platform == 'windows') {
-        trigger.count = trigger.every ? 5 : 1;
-    }
-
-    if (trigger.every && device.platform == 'windows') {
-        trigger.every = trigger.every.toString();
-    }
-
     if (!isCal) {
         trigger.notifyOnEntry = !!trigger.notifyOnEntry;
         trigger.notifyOnExit  = trigger.notifyOnExit === true;