Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

Commit 36427be

Browse files
authored
Merge pull request #1287 from ssbc/searchbar-slash-profile
Allow navigation to my own profile via search bar.
2 parents b46eb2b + 25a1b62 commit 36427be

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

lib/depject/app/html/search.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ const electron = require('electron')
77
exports.needs = nest({
88
'profile.async.suggest': 'first',
99
'channel.async.suggest': 'first',
10-
'intl.sync.i18n': 'first'
10+
'intl.sync.i18n': 'first',
11+
'keys.sync.id': 'first'
1112
})
1213

1314
exports.gives = nest('app.html.search')
1415

15-
const pages = ['/public', '/private', '/mentions', '/all', '/gatherings', '/participating', '/attending-gatherings']
16+
const pages = ['/public', '/private', '/mentions', '/all', '/gatherings', '/participating', '/attending-gatherings', '/profile']
1617

1718
exports.create = function (api) {
1819
const i18n = api.intl.sync.i18n
@@ -78,10 +79,18 @@ exports.create = function (api) {
7879

7980
function getPageSuggestions (input) {
8081
return pages.sort().filter(p => p.startsWith(input.toLowerCase())).map(p => {
82+
if (p !== '/profile') {
83+
return {
84+
id: p,
85+
value: p,
86+
title: p
87+
}
88+
}
89+
const id = api.keys.sync.id()
8190
return {
82-
id: p,
83-
value: p,
84-
title: p
91+
id: id,
92+
value: '/profile',
93+
title: '/profile'
8594
}
8695
})
8796
}

0 commit comments

Comments
 (0)