web-manager 4.1.4 → 4.1.6
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.
|
@@ -256,6 +256,7 @@ class Notifications {
|
|
|
256
256
|
try {
|
|
257
257
|
const firestore = this.manager.firestore();
|
|
258
258
|
const user = this.manager.auth().getUser();
|
|
259
|
+
const storage = this.manager.storage();
|
|
259
260
|
|
|
260
261
|
if (!token) {
|
|
261
262
|
return;
|
|
@@ -278,8 +279,8 @@ class Notifications {
|
|
|
278
279
|
|
|
279
280
|
// Determine if we need to update
|
|
280
281
|
const currentUid = user?.uid || null;
|
|
281
|
-
const
|
|
282
|
-
const needsUpdate =
|
|
282
|
+
const existingOwner = existingData?.owner || null;
|
|
283
|
+
const needsUpdate = existingOwner !== currentUid;
|
|
283
284
|
|
|
284
285
|
// Common data for both create and update
|
|
285
286
|
const baseData = {
|
|
@@ -290,7 +291,7 @@ class Notifications {
|
|
|
290
291
|
timestamp,
|
|
291
292
|
timestampUNIX
|
|
292
293
|
},
|
|
293
|
-
|
|
294
|
+
owner: currentUid
|
|
294
295
|
};
|
|
295
296
|
|
|
296
297
|
// Create or update the document as needed
|
|
@@ -300,6 +301,7 @@ class Notifications {
|
|
|
300
301
|
...baseData,
|
|
301
302
|
token,
|
|
302
303
|
tags: ['general'],
|
|
304
|
+
attribution: storage.get('attribution', {}),
|
|
303
305
|
created: {
|
|
304
306
|
timestamp,
|
|
305
307
|
timestampUNIX
|
package/package.json
CHANGED