git ssb

2+

mixmix / ticktack



Commit c81c05e4658be6e4d6da1fb5db9fd0f50033e6f9

disable publishing of empty blogs

mix irving committed on 2/14/2018, 12:35:16 AM
Parent: 140bd2aa4c9baa0075ccea378b2376a4c90cf8fc

Files changed

message/html/compose.jschanged
message/html/compose.jsView
@@ -1,7 +1,8 @@
11 const nest = require('depnest')
22 const { h, when, send, resolve, Value, computed, map } = require('mutant')
33 const assign = require('lodash/assign')
4 +const isEmpty = require('lodash/isEmpty')
45 const ssbMentions = require('ssb-mentions')
56 const addSuggest = require('suggest-box')
67
78 exports.gives = nest('message.html.compose')
@@ -133,11 +134,15 @@
133134
134135 // scoped
135136
136137 function publish () {
137- publishBtn.disabled = true
138 + if (publishBtn.disabled) return
139 +
138140 const text = resolve(textRaw)
141 + if (isEmpty(text)) return
139142
143 + publishBtn.disabled = true
144 +
140145 const mentions = ssbMentions(text).map(mention => {
141146 // merge markdown-detected mention with file info
142147 var file = filesById[mention.link]
143148 if (file) {

Built with git-ssb-web