aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes
diff options
context:
space:
mode:
Diffstat (limited to 'src/routes')
-rw-r--r--src/routes/(app)/+layout.svelte10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/routes/(app)/+layout.svelte b/src/routes/(app)/+layout.svelte
index 6b211563..c01ed368 100644
--- a/src/routes/(app)/+layout.svelte
+++ b/src/routes/(app)/+layout.svelte
@@ -244,7 +244,15 @@
// Auto-unlock nostr key if silent entropy is available
import("$lib/seed").then(({ autoUnlockNostr }) => autoUnlockNostr(user.pubkey));
- // TODO: unread DM badge via MLS
+ // Ensure MLS key package is published (once per session)
+ if (user.pubkey && !sessionStorage.getItem("kp-checked")) {
+ sessionStorage.setItem("kp-checked", "1");
+ import("$lib/messaging").then(({ fetchKeyPackage, publishKeyPackage }) => {
+ fetchKeyPackage(user.pubkey).then((kp) => {
+ if (!kp) publishKeyPackage(user).catch(() => {});
+ }).catch(() => {});
+ });
+ }
}
// if (window.NDEFReader) {