Commit 2f83e7af39eb4c09a1137daf878303e383a8ed3c
woopsfix
mixmix committed on 11/23/2018, 11:36:51 AMParent: c948308a09c8225c1c36b7910e2f7c3e8522127e
Files changed
message/html/like.js | changed |
message/html/like.js | ||
---|---|---|
@@ -1,7 +1,8 @@ | ||
1 | -var { h, computed } = require('mutant') | |
2 | -var nest = require('depnest') | |
1 … | +const { h, computed } = require('mutant') | |
2 … | +const nest = require('depnest') | |
3 | 3 … | const Scuttle = require('scuttle-thread') |
4 … | +const { isLink } = require('ssb-ref') | |
4 | 5 … | |
5 | 6 … | exports.needs = nest({ |
6 | 7 … | 'keys.sync.id': 'first', |
7 | 8 … | 'message.obs.likes': 'first', |
@@ -19,8 +20,10 @@ | ||
19 | 20 … | // TODO make this full-async : |
20 | 21 … | // - get whether i like this currently |
21 | 22 … | // - only update after I click like/ unlike |
22 | 23 … | |
24 … | + if (!isLink(msg.key)) return | |
25 … | + | |
23 | 26 … | return computed(api.message.obs.likes(msg.key), likes => { |
24 | 27 … | const iLike = likes.includes(id) |
25 | 28 … | |
26 | 29 … | return h('MessageLike', |
Built with git-ssb-web