From a0a048bbe75e8502710c4db6a4e236928ac1c73c Mon Sep 17 00:00:00 2001 From: Thomas Mathews Date: Mon, 2 Jan 2023 15:30:00 -0800 Subject: [PATCH] Fix click_update_profile object assignment --- index.html | 2 +- js/ui/util.js | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 6371f25..56eb9b8 100644 --- a/index.html +++ b/index.html @@ -197,7 +197,7 @@ Sign Out - + diff --git a/js/ui/util.js b/js/ui/util.js index eefb8f5..da08754 100644 --- a/js/ui/util.js +++ b/js/ui/util.js @@ -342,13 +342,12 @@ function show_profile_editor() { function click_update_profile() { const el = find_node("#profile-editor"); const btn = find_node("button.action", el); - const p = { + const p = Object.assign({}, model_get_profile(DAMUS, DAMUS.pubkey).data, { name: find_node("input[name='name']", el).value, picture: find_node("input[name='picture']", el).value, nip05: find_node("input[name='nip05']", el).value, about: find_node("textarea[name='about']", el).value, - }; - Object.assign(p, model_get_profile(DAMUS, DAMUS.pubkey).data, p); + }); update_profile(p); close_modal(el); // TODO show toast that say's "broadcasted!"