Skip to content

Commit

Permalink
fix(onesignal): ensure no duplicate script is added (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
pooya parsa committed Mar 17, 2019
1 parent 9aa76f8 commit 89c1a1d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/onesignal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,13 @@ function addOneSignal (moduleOptions) {
}

// Add the oneSignal SDK script to head
this.options.head.script.push({
async: true,
src: options.OneSignalSDK
})
if (!this.options.head.script.find(s => s.hid === 'onesignal')) {
this.options.head.script.push({
async: true,
src: options.OneSignalSDK,
hid: 'onesignal'
})
}

// Adjust manifest for oneSignal
if (!this.options.manifest) {
Expand Down

0 comments on commit 89c1a1d

Please sign in to comment.