aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-03-06 10:12:28 -0800
committerAdam Soltys <[email protected]>2026-03-06 10:12:28 -0800
commit0020101f8f1d83fb323c77d0620af821be9d4e66 (patch)
tree509e9107c8ccb129ed9701e12cdfa2601313e2c6 /src
parent47316e28150953909c71adfd1e9100c4e08024b1 (diff)
downloadcoinos-ui-0020101f8f1d83fb323c77d0620af821be9d4e66.tar.gz
coinos-ui-0020101f8f1d83fb323c77d0620af821be9d4e66.zip
chat fixes
Diffstat (limited to 'src')
-rw-r--r--src/lib/messaging.ts1
-rw-r--r--src/routes/(app)/+layout.svelte10
2 files changed, 10 insertions, 1 deletions
diff --git a/src/lib/messaging.ts b/src/lib/messaging.ts
index ae91709c..1eb59b9c 100644
--- a/src/lib/messaging.ts
+++ b/src/lib/messaging.ts
@@ -6,6 +6,7 @@
export {
publishKeyPackage,
+ fetchKeyPackage,
getGroups,
getGroupRumours,
sendGroupMessage,
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) {