mirror of
https://github.com/vale981/tridactyl
synced 2025-03-04 17:11:40 -05:00
Add fuse search in undo and fix undo session id is undefind
Allow fuse search with url in undo completion. Fix undo access undefined value in session, though I don't see anyone cares the return value of undo.
This commit is contained in:
parent
c90482042e
commit
b81c9dcdb7
2 changed files with 3 additions and 3 deletions
|
@ -52,7 +52,7 @@ class SessionCompletionOption
|
|||
this.value = (session.tab || session.window).sessionId
|
||||
const [howLong, qualifier] = computeDate(session)
|
||||
const [tab, extraInfo] = getTabInfo(session)
|
||||
this.fuseKeys.push(tab.title)
|
||||
this.fuseKeys.push(tab.title, tab.url)
|
||||
this.html = html`<tr class="SessionCompletionOption option">
|
||||
<td class="type">${session.tab ? "T" : "W"}</td>
|
||||
<td class="time">${howLong}${qualifier}</td>
|
||||
|
|
|
@ -2997,8 +2997,8 @@ export async function undo(item = "recent"): Promise<number> {
|
|||
const session = sessions.find(predicate)
|
||||
|
||||
if (session) {
|
||||
browser.sessions.restore((session.tab || session.window).sessionId)
|
||||
return (session.tab || session.window).id
|
||||
const restore = await browser.sessions.restore((session.tab || session.window).sessionId)
|
||||
return (restore.tab || restore.window).id
|
||||
}
|
||||
return -1
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue