fix
This commit is contained in:
parent
6327d56749
commit
7cc7b7d099
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -42,13 +42,6 @@ const w = window as unknown as {
|
|||
};
|
||||
|
||||
export const initExtNotif = async (vi: VG, prasi_ext: PrasiExt) => {
|
||||
w.notif = {
|
||||
async send() {},
|
||||
register() {},
|
||||
onReceive(notif) {},
|
||||
onTap(notif) {},
|
||||
};
|
||||
|
||||
if (window.parent) {
|
||||
window.addEventListener("message", async ({ data: raw }) => {
|
||||
if (typeof raw === "object" && raw.mobile) {
|
||||
|
|
@ -118,6 +111,12 @@ export const initExtNotif = async (vi: VG, prasi_ext: PrasiExt) => {
|
|||
});
|
||||
|
||||
window.parent.postMessage({ mobile: true, type: "ready" }, "*");
|
||||
w.notif = {
|
||||
async send() {},
|
||||
register() {},
|
||||
onReceive(notif) {},
|
||||
onTap(notif) {},
|
||||
};
|
||||
w.notif.register = async (user_id: any) => {
|
||||
await waitUntil(() => prasi_ext.notif?.token);
|
||||
if (vi && vi.site.api && prasi_ext.notif?.token) {
|
||||
|
|
@ -130,6 +129,7 @@ export const initExtNotif = async (vi: VG, prasi_ext: PrasiExt) => {
|
|||
};
|
||||
}
|
||||
|
||||
if (w.notif) {
|
||||
w.notif.send = async (data: NOTIF_ARG) => {
|
||||
if (vi && vi.site.api) {
|
||||
return await vi.site.api._notif("send", {
|
||||
|
|
@ -144,4 +144,5 @@ export const initExtNotif = async (vi: VG, prasi_ext: PrasiExt) => {
|
|||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue