mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
ui: fix omnibar record link generation
This commit is contained in:
1 parent
37af6fd5a6
commit
1a71693cd2
1 file changed
+4
-4
@@ -40,17 +40,17 @@ export default new AutoloadPage('omnibar', () => {
|
||||
<>
|
||||
{searching && <div>Searching...</div>}
|
||||
{pdocs.length > 0 && <div className="omnibar-content-title">{i18n('Problems')}</div>}
|
||||
{pdocs.map(({
|
||||
domainId, docId, pid, title, nSubmit, nAccept,
|
||||
{pdocs.map((i) => ({ ...i, base: i.domainId !== UiContext.domainId ? `/d/${i.domainId}` : prefix })).map(({
|
||||
domainId, docId, pid, title, nSubmit, nAccept, base,
|
||||
}) => (
|
||||
<a
|
||||
key={domainId + docId}
|
||||
className="omnibar-content-section omnibar-problem"
|
||||
href={`${domainId !== UiContext.domainId ? `/d/${domainId}` : prefix}/p/${pid || docId}`}
|
||||
href={`${base}/p/${pid || docId}`}
|
||||
>
|
||||
<div>
|
||||
<a
|
||||
href={psdict[`${domainId}#${docId}`]?.rid && `/record/${psdict[`${domainId}#${docId}`]?.rid}`}
|
||||
href={psdict[`${domainId}#${docId}`]?.rid && `${base}/record/${psdict[`${domainId}#${docId}`]?.rid}`}
|
||||
className={`record-status--text ${STATUS_CODES[psdict[`${domainId}#${docId}`]?.status]}`}
|
||||
>
|
||||
<span className={`icon record-status--icon ${STATUS_CODES[psdict[`${domainId}#${docId}`]?.status]}`}></span>
|
||||
|
||||
Reference in new issue
Block a user