feat : comment feature
CI / Verify (push) Successful in 2m30s
CI / Build immutable images and deploy (push) Successful in 3m9s

This commit is contained in:
2026-10-08 01:40:08 +07:00 Unverified
parent 8c8815cda5
commit 5812d99715
65 changed files with 27013 additions and 10 deletions
+3
View File
@@ -20,6 +20,7 @@ export async function syncCommissionPush(scope: "customer" | "admin", publicKey:
export async function unsubscribeCommissionPush() {
sessionStorage.removeItem("commission-push-synced-customer");
sessionStorage.removeItem("commission-push-synced-admin");
for (const key of Object.keys(sessionStorage)) if (key.startsWith("comment-push-synced-")) sessionStorage.removeItem(key);
if (!("serviceWorker" in navigator)) return;
const registration = await navigator.serviceWorker.getRegistration("/");
const subscription = await registration?.pushManager.getSubscription();
@@ -27,5 +28,7 @@ export async function unsubscribeCommissionPush() {
await fetch("/api/commission/push-subscription", { method: "DELETE",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ endpoint: subscription.endpoint }) }).catch(() => undefined);
await fetch("/api/comments/push-subscription", { method: "DELETE", headers: { "Content-Type": "application/json" },
body: JSON.stringify({ endpoint: subscription.endpoint }) }).catch(() => undefined);
await subscription.unsubscribe();
}