fix(views): clear the selection when entering a view without checkboxes
The batch bar survived into vault health, the authenticator grid and the audit log, none of which render checkboxes - it kept offering Delete, Move to folder and Add tag on entries the user could no longer see selected.
This commit is contained in:
@@ -2288,12 +2288,21 @@ async function addTagToEntry(id, tag) {
|
||||
} catch (err) { toast(err.message, 'error'); }
|
||||
}
|
||||
|
||||
// Views that render no checkboxes: audit log, authenticator grid, vault health.
|
||||
const VIEWS_WITHOUT_SELECTION = ['audit', 'authenticator', 'health'];
|
||||
|
||||
function renderGrid() {
|
||||
$('#contentTitle').textContent = viewTitle();
|
||||
// Re-apply the keyboard cursor after the grid re-renders. Defer one
|
||||
// tick so the new cards are in the DOM before we query for them.
|
||||
setTimeout(applyCursorHighlight, 0);
|
||||
|
||||
// A selection made in the list survived into these views, where nothing
|
||||
// shows what is selected — yet the batch bar still offered Delete, Move to
|
||||
// folder and Add tag on rows the user could no longer see.
|
||||
if (state.checked.size && VIEWS_WITHOUT_SELECTION.indexOf(state.view) !== -1)
|
||||
state.checked.clear();
|
||||
|
||||
// Audit log: read-only chronological feed, custom render.
|
||||
if (state.view === 'audit') {
|
||||
if (authTickTimer) { clearInterval(authTickTimer); authTickTimer = null; }
|
||||
|
||||
Reference in New Issue
Block a user