nodebb-plugin-web-push 0.6.1 → 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/library.js +4 -2
  2. package/package.json +1 -1
package/library.js CHANGED
@@ -99,7 +99,7 @@ plugin.addRoutes = async ({ router, middleware, helpers }) => {
99
99
  nid: utils.generateUUID(),
100
100
  bodyShort: 'Test notification',
101
101
  bodyLong: 'This is a test message sent from NodeBB',
102
- path: `${nconf.get('url')}/me/web-push`,
102
+ path: `/me/web-push`,
103
103
  }, req.uid, userLang);
104
104
  await webPush.sendNotification(subscription, JSON.stringify(payload));
105
105
  });
@@ -223,7 +223,9 @@ async function constructPayload(notification, uid, lang) {
223
223
  }
224
224
 
225
225
  icon = icon || `${nconf.get('url')}/apple-touch-icon`;
226
- badge = badge || `${nconf.get('url')}/apple-touch-icon`;
226
+ if (!badge) { // badge fallbacks
227
+ badge = `${nconf.get('url')}${meta.config['brand:maskableIcon'] || '/apple-touch-icon'}`;
228
+ }
227
229
 
228
230
  return {
229
231
  title,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-web-push",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "A starter kit for quickly creating NodeBB plugins",
5
5
  "main": "library.js",
6
6
  "repository": {