Signal conversations open inside Chat instead of switching to the Signal screen
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
78fd07bd0d
commit
7a07ac5e11
5 files changed
+26
-10
No files matched your search
@@ -38,7 +38,15 @@ async function chLoadSignal() {
|
||||
ch.sig = []; if (typeof allowed !== 'function' || !allowed('signal') || typeof sgApi !== 'function') return;
|
||||
try { const r = await sgApi('/convs'); ch.sig = (r.convs || []).map(c => ({ ...c, source: 'signal', name: c.name || c.id })); } catch { ch.sig = []; }
|
||||
}
|
||||
const chSigRow = c => `<a class="row sgrow" data-sig="1" href="#/signal/${encodeURIComponent(c.id)}"><span class="sgav" style="background:${sgColor(c.id)}">${c.type === 'group' ? icon('chat') : esc(sgInitial(c.name))}</span>
|
||||
const chSigRow = c => `<a class="row sgrow ${c.id === ch.curSig ? 'on' : ''}" data-sig="1" href="${sgHref(c.id)}"><span class="sgav" style="background:${sgColor(c.id)}">${c.type === 'group' ? icon('chat') : esc(sgInitial(c.name))}</span>
|
||||
<span class="grow"><b>${esc(c.name)} <small class="srcbadge">Signal</small></b><small>${esc(c.preview || '')}</small></span><span class="sgside"><small>${c.ts ? sgTime(c.ts) : ''}</small>${c.unread ? `<i class="nbadge" style="position:static">${c.unread}</i>` : ''}</span></a>`;
|
||||
/** Signal changed (a message came in): redraw the Chat list if it is showing. */
|
||||
function chSigChanged() { if (typeof ch !== 'undefined' && ch.root && document.contains(ch.root) && location.hash.startsWith('#/chat')) chLoadSignal().then(() => { if (chq('#chlist')) chDrawList(); }); }
|
||||
|
||||
/** A Signal conversation shown in Chat's own conversation pane (so choosing one in the combined list never leaves Chat). */
|
||||
async function chShowSignal() {
|
||||
const box = chq('#chm'); if (!box) return;
|
||||
if (!box.querySelector('#sgm')) { box.innerHTML = '<div id="sgm" class="sgin"></div>'; sg.reply = null; sg.tray = []; }
|
||||
sg.root = ch.root; sg.dock = false; sg.inChat = true; sg.cur = ch.curSig;
|
||||
await sgDrawThread(true);
|
||||
}
|
||||
Reference in new issue
Block a user