Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cordova-plugin-local-notifications
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nabil Sadki
cordova-plugin-local-notifications
Commits
46dc0dae
Commit
46dc0dae
authored
Oct 09, 2017
by
Sebastián Katzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some fixes in convertTrigger to only include valid value-pairs
parent
e599fa6b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
10 deletions
+15
-10
local-notification-util.js
www/local-notification-util.js
+15
-10
No files found.
www/local-notification-util.js
View file @
46dc0dae
...
...
@@ -191,10 +191,7 @@ exports.convertActions = function (options) {
* @return [ Map ] Interaction object with trigger spec.
*/
exports
.
convertTrigger
=
function
(
options
)
{
var
cfg
=
options
.
trigger
,
isDate
=
Date
.
prototype
.
isPrototypeOf
(
cfg
),
isObject
=
Object
.
prototype
.
isPrototypeOf
(
cfg
),
trigger
=
!
isDate
&&
isObject
?
cfg
:
{},
var
trigger
=
options
.
trigger
||
{},
date
=
this
.
getValueFor
(
trigger
,
'at'
,
'firstAt'
,
'date'
);
if
(
!
trigger
.
type
)
{
...
...
@@ -204,18 +201,22 @@ exports.convertTrigger = function (options) {
var
isCal
=
trigger
.
type
==
'calendar'
;
if
(
isCal
&&
!
date
)
{
date
=
this
.
getValueFor
(
options
,
'at'
,
'firstAt'
,
'date'
)
||
new
Date
();
}
if
(
isCal
)
{
date
=
typeof
date
==
'object'
?
date
.
getTime
()
:
date
;
trigger
.
at
=
Math
.
round
(
date
/
1000
);
date
=
this
.
getValueFor
(
options
,
'at'
,
'firstAt'
,
'date'
);
}
if
(
isCal
&&
!
trigger
.
every
&&
options
.
every
)
{
trigger
.
every
=
options
.
every
;
}
if
(
isCal
&&
(
trigger
.
in
||
trigger
.
every
))
{
date
=
null
;
}
if
(
isCal
&&
date
)
{
date
=
typeof
date
==
'object'
?
date
.
getTime
()
:
date
;
trigger
.
at
=
Math
.
round
(
date
/
1000
);
}
if
(
!
trigger
.
count
&&
device
.
platform
==
'windows'
)
{
trigger
.
count
=
trigger
.
every
?
5
:
1
;
}
...
...
@@ -230,6 +231,10 @@ exports.convertTrigger = function (options) {
trigger
.
radius
=
trigger
.
radius
||
5
;
}
if
(
!
isCal
||
trigger
.
at
)
{
delete
trigger
.
every
;
}
delete
options
.
every
;
delete
options
.
at
;
delete
options
.
firstAt
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment