From b822228b004f943f0275d8ce3c1f9e8cdbbc0521 Mon Sep 17 00:00:00 2001 From: tamaina Date: Sun, 14 Feb 2021 23:10:09 +0900 Subject: [PATCH] wip --- src/client/scripts/initialize-sw.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/client/scripts/initialize-sw.ts b/src/client/scripts/initialize-sw.ts index 7a364f10c3..1eef8aa0f8 100644 --- a/src/client/scripts/initialize-sw.ts +++ b/src/client/scripts/initialize-sw.ts @@ -1,6 +1,6 @@ import { instance } from '@/instance'; import { $i } from '@/account'; -import { api } from '@/os'; +import { api, post } from '@/os'; import { lang } from '@/config'; import { SwMessage } from '@/sw/types'; @@ -54,7 +54,12 @@ navigator.serviceWorker.addEventListener('message', ev => { const data = ev.data as SwMessage; if (data.type !== 'order') return; - data.order + switch (data.order) { + case 'post': + return post(data.options); + default: + return; + } }); /**