Skip to content
This repository was archived by the owner on Oct 13, 2026. It is now read-only.

Commit 89c1a1d

Browse files
author
pooya parsa
committed
fix(onesignal): ensure no duplicate script is added (#161)
1 parent 9aa76f8 commit 89c1a1d

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

‎packages/onesignal/index.js‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,13 @@ function addOneSignal (moduleOptions) {
7171
}
7272

7373
// Add the oneSignal SDK script to head
74-
this.options.head.script.push({
75-
async: true,
76-
src: options.OneSignalSDK
77-
})
74+
if (!this.options.head.script.find(s => s.hid === 'onesignal')) {
75+
this.options.head.script.push({
76+
async: true,
77+
src: options.OneSignalSDK,
78+
hid: 'onesignal'
79+
})
80+
}
7881

7982
// Adjust manifest for oneSignal
8083
if (!this.options.manifest) {

0 commit comments

Comments
 (0)