Commit 5026c6f808f432b3b52dabce2f2f1ff044390434
upgrade patch-suggest (using new ssb-suggest)
mixmix committed on 1/22/2019, 4:52:34 AMParent: 439fbef15cdf6f2dfef52be98bc123702d6b9d2c
Files changed
about/async/suggest.js | deleted |
config.js | changed |
package-lock.json | changed |
package.json | changed |
about/async/suggest.js | ||
---|---|---|
@@ -1,42 +1,0 @@ | ||
1 | -const nest = require('depnest') | |
2 | -const { onceTrue } = require('mutant') | |
3 | - | |
4 | -var fallbackImageUrl = 'data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==' | |
5 | - | |
6 | -exports.gives = nest('about.async.suggest') | |
7 | - | |
8 | -exports.needs = nest({ | |
9 | - 'blob.sync.url': 'first', | |
10 | - 'sbot.obs.connection': 'first' | |
11 | -}) | |
12 | - | |
13 | -exports.create = function (api) { | |
14 | - return nest('about.async.suggest', suggestedProfile) | |
15 | - | |
16 | - // TODO rework this top API! | |
17 | - function suggestedProfile (text, defaultIds, cb) { | |
18 | - if (cb === undefined && typeof defaultIds === 'function') return suggestedProfile(text, [], defaultIds) | |
19 | - | |
20 | - onceTrue(api.sbot.obs.connection, ssb => { | |
21 | - ssb.suggest.profile({ text, defaultIds, limit: 20 }, (err, items) => { | |
22 | - if (err) return cb(err) | |
23 | - | |
24 | - cb(null, items.map(Suggestion)) | |
25 | - }) | |
26 | - }) | |
27 | - | |
28 | - return true // stop at this depject | |
29 | - } | |
30 | - | |
31 | - function Suggestion (item) { | |
32 | - return { | |
33 | - title: item.name, | |
34 | - id: item.id, | |
35 | - subtitle: item.id.substring(0, 10), | |
36 | - value: `[@${item.name}](${item.id})`, | |
37 | - cls: item.following ? 'following' : null, | |
38 | - image: item.image ? api.blob.sync.url(item.image) : fallbackImageUrl, | |
39 | - showBoth: true | |
40 | - } | |
41 | - } | |
42 | -} |
config.js | ||
---|---|---|
@@ -1,7 +1,6 @@ | ||
1 | 1 … | const nest = require('depnest') |
2 | 2 … | const Config = require('ssb-config/inject') |
3 | -const ssbKeys = require('ssb-keys') | |
4 | 3 … | const Path = require('path') |
5 | 4 … | const merge = require('lodash/merge') |
6 | 5 … | |
7 | 6 … | const appName = process.env.ssb_appname || 'ssb' |
@@ -14,9 +13,8 @@ | ||
14 | 13 … | if (config) return config |
15 | 14 … | |
16 | 15 … | console.log('LOADING config') |
17 | 16 … | config = Config(appName, opts) |
18 | - // config.keys = ssbKeys.loadOrCreateSync(Path.join(config.path, 'secret')) | |
19 | 17 … | |
20 | 18 … | config = merge( |
21 | 19 … | config, |
22 | 20 … | Connections(config), |
@@ -28,10 +26,10 @@ | ||
28 | 26 … | } |
29 | 27 … | |
30 | 28 … | function Connections (config) { |
31 | 29 … | const connections = (process.platform === 'win32') |
32 | - ? undefined // this seems wrong? | |
33 | - : { incoming: { unix: [{ 'scope': 'local', 'transform': 'noauth', server: true }] } } | |
30 … | + ? undefined | |
31 … | + : { incoming: { unix: [{ scope: 'local', transform: 'noauth', server: true }] } } | |
34 | 32 … | |
35 | 33 … | return connections ? { connections } : {} |
36 | 34 … | } |
37 | 35 … |
package-lock.json | ||
---|---|---|
The diff is too large to show. Use a local git client to view these changes. Old file size: 400245 bytes New file size: 403653 bytes |
package.json | ||
---|---|---|
@@ -69,9 +69,9 @@ | ||
69 | 69 … | "patch-drafts": "0.0.6", |
70 | 70 … | "patch-history": "^1.0.0", |
71 | 71 … | "patch-inbox": "^1.3.1", |
72 | 72 … | "patch-settings": "^1.1.2", |
73 | - "patch-suggest": "^2.0.2", | |
73 … | + "patch-suggest": "^3.0.1", | |
74 | 74 … | "patchbay-book": "^1.0.8", |
75 | 75 … | "patchbay-dark-crystal": "^2.0.0", |
76 | 76 … | "patchbay-gatherings": "^3.2.8", |
77 | 77 … | "patchbay-poll": "^1.1.3", |
@@ -92,12 +92,11 @@ | ||
92 | 92 … | "ssb-blob-files": "^1.1.3", |
93 | 93 … | "ssb-blobs": "^1.1.6", |
94 | 94 … | "ssb-chess-db": "^1.0.5", |
95 | 95 … | "ssb-chess-mithril": "^1.0.7", |
96 | - "ssb-config": "^2.3.7", | |
96 … | + "ssb-config": "^3.2.2", | |
97 | 97 … | "ssb-ebt": "^5.2.3", |
98 | 98 … | "ssb-friends": "^3.1.10", |
99 | - "ssb-keys": "^7.0.15", | |
100 | 99 … | "ssb-meme": "^1.0.4", |
101 | 100 … | "ssb-mentions": "^0.5.0", |
102 | 101 … | "ssb-mutual": "^0.1.0", |
103 | 102 … | "ssb-private": "^0.2.3", |
@@ -105,8 +104,9 @@ | ||
105 | 104 … | "ssb-ref": "^2.13.6", |
106 | 105 … | "ssb-search": "^1.1.2", |
107 | 106 … | "ssb-server": "^13.5.2", |
108 | 107 … | "ssb-sort": "^1.1.0", |
108 … | + "ssb-suggest": "^1.0.2", | |
109 | 109 … | "ssb-unread": "^1.0.2", |
110 | 110 … | "ssb-ws": "^4.0.1", |
111 | 111 … | "suggest-box": "^2.2.3", |
112 | 112 … | "text-node-searcher": "^1.1.1", |
Built with git-ssb-web