Commit 0451703ba7a81e3790d83f8b1f67c50f96392836
don't display public key as default name on first start up
Matt McKegg committed on 4/7/2017, 7:26:57 AMParent: 3d32dd2cc4892720337acdff65bf871556608561
Files changed
modules/profile/sheet/edit.js | changed |
modules/profile/sheet/edit.js | ||
---|---|---|
@@ -28,9 +28,11 @@ | ||
28 | 28 … | var currentDescription = api.about.obs.description(id) |
29 | 29 … | |
30 | 30 … | var publishing = Value(false) |
31 | 31 … | var chosenImage = Value(currentImage()) |
32 | - var chosenName = Value(currentName()) | |
32 … | + | |
33 … | + // don't display if name is default | |
34 … | + var chosenName = Value(currentName() === id.slice(1, 10) ? '' : currentName()) | |
33 | 35 … | var chosenDescription = Value(currentDescription()) |
34 | 36 … | |
35 | 37 … | return { |
36 | 38 … | content: h('div', { |
@@ -85,11 +87,12 @@ | ||
85 | 87 … | |
86 | 88 … | function save () { |
87 | 89 … | // no confirm |
88 | 90 … | var update = {} |
91 … | + var newName = chosenName().trim() || currentName() | |
89 | 92 … | |
90 | 93 … | if (chosenImage() !== currentImage()) update.image = chosenImage() |
91 | - if (chosenName() !== currentName()) update.name = chosenName() | |
94 … | + if (newName !== currentName()) update.name = newName | |
92 | 95 … | if (chosenDescription() !== currentDescription()) update.description = chosenDescription() |
93 | 96 … | |
94 | 97 … | if (Object.keys(update).length) { |
95 | 98 … | publishing.set(true) |
Built with git-ssb-web