@social-mail/social-mail-client 1.8.360 → 1.8.361
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.
- package/dist/admin/AdminAppIndex.pack.js +56 -56
- package/dist/admin/AdminAppIndex.pack.js.map +1 -1
- package/dist/admin/AdminAppIndex.pack.min.js +1 -1
- package/dist/admin/AdminAppIndex.pack.min.js.map +1 -1
- package/dist/public/store/cart/ShoppingCart.pack.js +5 -55
- package/dist/public/store/cart/ShoppingCart.pack.js.map +1 -1
- package/dist/public/store/cart/ShoppingCart.pack.min.js +1 -1
- package/dist/public/store/cart/ShoppingCart.pack.min.js.map +1 -1
- package/dist/services/LoginService.d.ts.map +1 -1
- package/dist/services/LoginService.js +3 -16
- package/dist/services/LoginService.js.map +1 -1
- package/dist/services/WebPushService.d.ts.map +1 -1
- package/dist/services/WebPushService.js +15 -2
- package/dist/services/WebPushService.js.map +1 -1
- package/dist/site-editor-app/SiteEditorApp.pack.js +56 -56
- package/dist/site-editor-app/SiteEditorApp.pack.js.map +1 -1
- package/dist/site-editor-app/SiteEditorApp.pack.min.js +1 -1
- package/dist/site-editor-app/SiteEditorApp.pack.min.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/web/AppIndex.pack.js +56 -56
- package/dist/web/AppIndex.pack.js.map +1 -1
- package/dist/web/AppIndex.pack.min.js +1 -1
- package/dist/web/AppIndex.pack.min.js.map +1 -1
- package/package.json +1 -1
- package/src/services/LoginService.ts +0 -17
- package/src/services/WebPushService.ts +21 -1
package/package.json
CHANGED
|
@@ -28,23 +28,6 @@ export default class LoginService {
|
|
|
28
28
|
if (this.user?.userID) {
|
|
29
29
|
// let start syncing...
|
|
30
30
|
// this.app.resolve(LocalDbService).syncAll(this.user.userID).catch(console.error);
|
|
31
|
-
if (PositronInBrowser.isAvailable) {
|
|
32
|
-
const deviceToken = await PositronInBrowser.run(function () {
|
|
33
|
-
|
|
34
|
-
// this runs inside App's Internal JavaScript Engine
|
|
35
|
-
const NSPositronAssembly = this.clr
|
|
36
|
-
.assembly("NeuroSpeech.Positron");
|
|
37
|
-
|
|
38
|
-
const Positron = NSPositronAssembly
|
|
39
|
-
.NeuroSpeech.Positron.Positron;
|
|
40
|
-
|
|
41
|
-
return Positron.instance.deviceToken;
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
if (deviceToken) {
|
|
45
|
-
await this.entityService.invoke(LoginSession, "updateDeviceToken", session, "fcm", deviceToken);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
31
|
}
|
|
49
32
|
return this.user;
|
|
50
33
|
}
|
|
@@ -5,6 +5,7 @@ import EntityService from "./EntityService";
|
|
|
5
5
|
import { LoginSession } from "../model/model";
|
|
6
6
|
import FetchBuilder from "@web-atoms/core/dist/services/FetchBuilder";
|
|
7
7
|
import { apiPath } from "../common/apiPath";
|
|
8
|
+
import PositronInBrowser from "@positron-js/context/dist/PositronInBrowser";
|
|
8
9
|
|
|
9
10
|
@DITransient()
|
|
10
11
|
export default class WebPushService {
|
|
@@ -14,7 +15,26 @@ export default class WebPushService {
|
|
|
14
15
|
|
|
15
16
|
async register() {
|
|
16
17
|
try {
|
|
17
|
-
|
|
18
|
+
|
|
19
|
+
if (PositronInBrowser.isAvailable) {
|
|
20
|
+
const deviceToken = await PositronInBrowser.run(function () {
|
|
21
|
+
|
|
22
|
+
// this runs inside App's Internal JavaScript Engine
|
|
23
|
+
const NSPositronAssembly = this.clr
|
|
24
|
+
.assembly("NeuroSpeech.Positron");
|
|
25
|
+
|
|
26
|
+
const Positron = NSPositronAssembly
|
|
27
|
+
.NeuroSpeech.Positron.Positron;
|
|
28
|
+
|
|
29
|
+
return Positron.instance.deviceToken;
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
if (deviceToken) {
|
|
33
|
+
const session = await this.entityService.query(LoginSession, "currentUser").firstOrDefault();
|
|
34
|
+
await this.entityService.invoke(LoginSession, "updateDeviceToken", session, "fcm", deviceToken);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
// ask for push...
|
|
18
38
|
if (!("serviceWorker" in navigator)) {
|
|
19
39
|
return;
|
|
20
40
|
}
|