Skip to content

Commit

Permalink
Stop audible unmuted tabs from being unloaded (#378)
Browse files Browse the repository at this point in the history
Adds filter for inaudible or unmuted tabs for candidate tabs that can be
unloaded.

closes #90
  • Loading branch information
josh-berry committed Jul 22, 2023
2 parents 752fca8 + 3682471 commit c6d77df
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ logErrorsFrom(async () => {
let tab_count = tabs.length;
let candidate_tabs = tabs
.filter(t => t.hidden && t.id !== undefined)
.filter(t => !t.audible || t.mutedInfo?.muted)
.sort((a, b) => (a.lastAccessed ?? 0) - (b.lastAccessed ?? 0));

const min_keep_tabs = model.options.local.state.autodiscard_min_keep_tabs;
Expand Down

0 comments on commit c6d77df

Please sign in to comment.