aboutsummaryrefslogtreecommitdiff
path: root/views.js
diff options
context:
space:
mode:
Diffstat (limited to 'views.js')
-rw-r--r--views.js24
1 files changed, 13 insertions, 11 deletions
diff --git a/views.js b/views.js
index 8b5922d..56cee4a 100644
--- a/views.js
+++ b/views.js
@@ -23,18 +23,20 @@ function profilePage (src, keys) {
input,
h('button', {
onclick: function () {
- content = {
- type: 'name',
- named: src,
- name: input.value
- }
- localforage.removeItem('name:' + src)
- publish(content, keys).then(post => {
- open(post).then(msg => {
- input.value = ''
- scroller.insertBefore(render(msg, keys), scroller.childNodes[1])
+ if (input.value) {
+ content = {
+ type: 'name',
+ named: src,
+ name: input.value
+ }
+ localforage.removeItem('name:' + src)
+ publish(content, keys).then(post => {
+ open(post).then(msg => {
+ input.value = ''
+ scroller.insertBefore(render(msg, keys), scroller.childNodes[1])
+ })
})
- })
+ }
}
}, ['Identify'])
])