Skip to content

Commit 4c1b3b6

Browse files
committed
遠征回収したときに遠征の通知を消すようにした
1 parent 993f1d4 commit 4c1b3b6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/controllers/WebRequest/kcsapi.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ export async function onMissionReturnInstruction([details]: chrome.webRequest.We
2929
}
3030

3131
export async function onMissionResult([details]: chrome.webRequest.WebRequestBodyDetails[]) {
32-
log.info("onMissionResult", details);
32+
const { api_deck_id: [api_deck_id] } = details.requestBody?.formData as unknown as { api_deck_id: string[], api_mission_id: string[] };
33+
const notifications = await (chrome.notifications as any).getAll() as Promise<Record<string, boolean>>;
34+
for (const id in notifications) {
35+
if (id.match(`/${EntryType.MISSION}/${api_deck_id}`)) chrome.notifications.clear(id);
36+
}
3337
}
3438

3539
export async function onRecoveryStart([details]: chrome.webRequest.WebRequestBodyDetails[]) {

0 commit comments

Comments
 (0)