Fix: "Clear my history" now clears account history too
clearSession only reset the device-local history; for a signed-in user the panel shows the account history (serverHistory), which was never cleared and never sent to the server — so it looked like nothing happened. Add DELETE /api/history (clear all) and have clearSession reset serverHistory + call it when signed in.
This commit is contained in:
@@ -124,8 +124,11 @@
|
||||
seenIds = new Set();
|
||||
dismissed = new Set();
|
||||
history = [];
|
||||
serverHistory = [];
|
||||
persistSession();
|
||||
P.saveJSON(BRIEF_VIEW_KEY, null);
|
||||
// Signed in? Also clear the account (cross-device) history on the server.
|
||||
if (auth.user) delJSON('/api/history').catch(() => {});
|
||||
showHistory = false;
|
||||
select(selected, true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user