git ssb

10+

Matt McKegg / patchwork



Commit 0451703ba7a81e3790d83f8b1f67c50f96392836

don't display public key as default name on first start up

Matt McKegg committed on 4/7/2017, 7:26:57 AM
Parent: 3d32dd2cc4892720337acdff65bf871556608561

Files changed

modules/profile/sheet/edit.jschanged
modules/profile/sheet/edit.jsView
@@ -28,9 +28,11 @@
2828 var currentDescription = api.about.obs.description(id)
2929
3030 var publishing = Value(false)
3131 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())
3335 var chosenDescription = Value(currentDescription())
3436
3537 return {
3638 content: h('div', {
@@ -85,11 +87,12 @@
8587
8688 function save () {
8789 // no confirm
8890 var update = {}
91 + var newName = chosenName().trim() || currentName()
8992
9093 if (chosenImage() !== currentImage()) update.image = chosenImage()
91- if (chosenName() !== currentName()) update.name = chosenName()
94 + if (newName !== currentName()) update.name = newName
9295 if (chosenDescription() !== currentDescription()) update.description = chosenDescription()
9396
9497 if (Object.keys(update).length) {
9598 publishing.set(true)

Built with git-ssb-web