aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/messages.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-08-15 16:01:48 -0700
committerAdam Soltys <[email protected]>2026-08-15 16:01:48 -0700
commiteb2ef578ab9a6e34390091901afcd6a93c703dcf (patch)
tree75d03c77dba825d6b6d98810b3f7233830888e82 /src/features/messages.js
parentcae7dcfbf8e1222f496cee003a436f24d5a43686 (diff)
downloadcoinosv3-eb2ef578ab9a6e34390091901afcd6a93c703dcf.tar.gz
coinosv3-eb2ef578ab9a6e34390091901afcd6a93c703dcf.zip
Log out lives in the profile card below Save, wearing the door-and-arrow
Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_014tE4U5nEjGTQy8PwYqamfv
Diffstat (limited to 'src/features/messages.js')
-rw-r--r--src/features/messages.js15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/features/messages.js b/src/features/messages.js
index 1edcba3..70407ad 100644
--- a/src/features/messages.js
+++ b/src/features/messages.js
@@ -1364,6 +1364,12 @@ export function messagesFeature(ctx) {
function profileScreen() {
const pk = ui.profilePk;
const mine = isMe(pk) || (ctx.shownPubkey && pk === ctx.shownPubkey());
+ const logoutBtn = () => h('button', {
+ class: 'btn-block', style: 'color:var(--red,#c0392b);display:flex;align-items:center;justify-content:center;gap:8px',
+ onClick: () => { ui.profilePk = null; ui.profEdit = null; ctx.logout && ctx.logout(); },
+ },
+ h('span', { style: 'display:flex', html: '<svg width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/><polyline points="16 17 21 12 16 7"/><line x1="21" y1="12" x2="9" y2="12"/></svg>' }),
+ t('logout'));
const full = fullProfiles.get(pk);
// Your own profile IS the editor — the form appears prefilled as soon as
// the published kind 0 arrives, no Edit step.
@@ -1418,9 +1424,10 @@ export function messagesFeature(ctx) {
field(t('profAbout'), 'about', '', true),
field(t('profPicture'), 'picture', 'https://…'),
h('button', { class: 'btn-primary btn-block', disabled: ui.profSaving, onClick: saveProfile },
- ui.profSaving ? h('span', { class: 'spinner sm' }) : t('save')))
+ ui.profSaving ? h('span', { class: 'spinner sm' }) : t('save')),
+ logoutBtn())
: mine
- ? null // the editor renders above once the kind 0 loads
+ ? logoutBtn() // the editor renders above once the kind 0 loads
: h('div', { class: 'row gap6 wrap' },
h('button', { class: 'btn-primary grow', onClick: () => {
const peer = pk;
@@ -1454,10 +1461,6 @@ export function messagesFeature(ctx) {
noteRow(pk, ev, name),
])));
})(),
- mine ? h('button', {
- class: 'btn-ghost btn-block', style: 'color:var(--red,#c0392b)',
- onClick: () => { ui.profilePk = null; ui.profEdit = null; ctx.logout && ctx.logout(); },
- }, t('logout')) : null,
h('button', { class: 'btn-ghost btn-block', onClick: () => { ui.profilePk = null; ui.profEdit = null; render(); } }, t('back')));
}