aboutsummaryrefslogtreecommitdiffstats
path: root/src/features
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-08-28 21:00:11 -0700
committerAdam Soltys <[email protected]>2026-08-28 21:00:11 -0700
commitf13acc1bf4ffa3d0e2733dc53041bbc61659a5af (patch)
tree2a67050e4800848dabe7fba7a7b9912e51b4025a /src/features
parent339e9badc0f06c098f2236af90501572bde1defa (diff)
downloadcoinosv3-f13acc1bf4ffa3d0e2733dc53041bbc61659a5af.tar.gz
coinosv3-f13acc1bf4ffa3d0e2733dc53041bbc61659a5af.zip
The profile editor learns to take a photo, not just a URL: an Upload button feeds the same signed nostr.build path the onboarding picker uses and fills the picture field with the result
Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_019eA8JRq9Wr7z2fRQk99HLi
Diffstat (limited to 'src/features')
-rw-r--r--src/features/messages.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/features/messages.js b/src/features/messages.js
index be1abf5..eea4fbf 100644
--- a/src/features/messages.js
+++ b/src/features/messages.js
@@ -1723,6 +1723,24 @@ export function messagesFeature(ctx) {
field(t('profDisplayName'), 'name'),
field(t('profAbout'), 'about', '', true),
field(t('profPicture'), 'picture', 'https://…'),
+ // or skip the URL entirely: pick a photo, we upload and fill it
+ h('div', { class: 'row gap6' },
+ h('button', {
+ class: 'btn-sm', type: 'button', disabled: !!ui.profUploading,
+ onClick: () => document.getElementById('prof-pic-file')?.click(),
+ }, ui.profUploading ? h('span', { class: 'spinner sm' }) : t('profUploadPic')),
+ h('input', {
+ id: 'prof-pic-file', type: 'file', accept: 'image/*', style: 'display:none',
+ onChange: async (e) => {
+ const f = e.target.files && e.target.files[0];
+ e.target.value = '';
+ if (!f || !ctx.uploadImage) return;
+ ui.profUploading = true; render();
+ try { if (ui.profEdit) ui.profEdit.picture = await ctx.uploadImage(f); }
+ catch (err) { toast(err.message); }
+ ui.profUploading = false; render();
+ },
+ })),
h('button', { class: 'btn-primary btn-block', disabled: ui.profSaving, onClick: saveProfile },
ui.profSaving ? h('span', { class: 'spinner sm' }) : t('save')),
logoutBtn())