Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions lib/depject/app/html/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ const electron = require('electron')
exports.needs = nest({
'profile.async.suggest': 'first',
'channel.async.suggest': 'first',
'intl.sync.i18n': 'first'
'intl.sync.i18n': 'first',
'keys.sync.id': 'first'
})

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

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

exports.create = function (api) {
const i18n = api.intl.sync.i18n
Expand Down Expand Up @@ -78,10 +79,18 @@ exports.create = function (api) {

function getPageSuggestions (input) {
return pages.sort().filter(p => p.startsWith(input.toLowerCase())).map(p => {
if (p !== '/profile') {
return {
id: p,
value: p,
title: p
}
}
const id = api.keys.sync.id()
return {
id: p,
value: p,
title: p
id: id,
value: '/profile',
title: '/profile'
}
})
}
Expand Down