Always return int from comparator

Even though it works fine, since comparator should always formally return int,
comply with this requirement to reduce chances of bugs in case sort implementation
changes
This commit is contained in:
Denis Revunov 2023-02-16 23:16:12 +03:00
parent e4cef503fc
commit d2f5c87693

View file

@ -8,7 +8,7 @@ import * as R from "ramda"
export async function getSortedTabs(): Promise<browser.tabs.Tab[]> {
const comp =
config.get("tabsort") === "mru"
? (a, b) => a.active || -b.active || b.lastAccessed - a.lastAccessed
? (a, b) => +a.active || -b.active || b.lastAccessed - a.lastAccessed
: (a, b) => a.index - b.index
const hiddenVal = config.get("tabshowhidden") === "true" ? undefined : false
return browserBg.tabs