aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/messages.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/features/messages.js')
-rw-r--r--src/features/messages.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/features/messages.js b/src/features/messages.js
index b491a5c..592c5dc 100644
--- a/src/features/messages.js
+++ b/src/features/messages.js
@@ -2332,6 +2332,13 @@ export function messagesFeature(ctx) {
// An invite link opened in the browser lands here before the wallet exists.
const urlInvite = typeof location !== 'undefined' ? parseInviteLink(location.href) : null;
if (urlInvite) { try { history.replaceState(null, '', '/'); } catch {} }
+ // /?chat: the public chat page's button on a device that has an account.
+ // It opens the coinos community's room itself once the wallet is open
+ // (init below), where "Open coinos" used to leave a signed-in reader on
+ // the wallet to find the chat (Andy, 2026-11-10).
+ let urlChat = typeof location !== 'undefined' && !urlInvite && location.pathname === '/'
+ && /(?:^|&)chat(?:=|&|$)/.test((location.search || '').slice(1));
+ if (urlChat) { try { history.replaceState(null, '', '/'); } catch {} }
// coinos's own pack share link, /emojis/pack/<naddr> — the Android app
// owns every v3.coinos.io path, so one tapped on a phone lands here, not
// in a browser; added once a wallet is open (init below).
@@ -19130,6 +19137,13 @@ export function messagesFeature(ctx) {
loadLinkInvite(urlInvite);
setTimeout(() => { ui.chatOpen = true; ui.msgView = 'home'; render(); }, 0);
}
+ if (urlChat) {
+ urlChat = false; // once: init runs again for every wallet born in this tab
+ setTimeout(() => {
+ ui.chatOpen = true; ui.msgView = 'room'; ui.msgCommunity = COMMUNITY.community_id;
+ ui.msgChannel = null; ui.msgStick = true; render();
+ }, 0);
+ }
if (urlPack) {
addPack(urlPack).catch(() => {});
setTimeout(() => { ui.chatOpen = true; ui.msgView = 'home'; render(); }, 0);