tabs: add clearURL method, loading tabs clears previous qps
Navigatable has clearURL, which for Search clears "search" qp, and invites clears "invite" qp. Tab interfaces optionally include "contentObject: AsTab", and show/hide funcs are passed the contentObject of the previously loaded tab if one is available, so that they can call it's clearURL method. This means searches you typed for the accounts tab won't pop up when switching to activity.
This commit is contained in:
@@ -818,6 +818,14 @@ export class DOMInviteList implements InviteList {
|
||||
this.focusInvite(inviteCode, window.lang.notif("errorInviteNotFound"));
|
||||
};
|
||||
|
||||
clearURL() {
|
||||
const url = new URL(window.location.href);
|
||||
if (!url.searchParams.has("invite")) return;
|
||||
url.searchParams.delete("invite");
|
||||
console.log("pushing", url.toString());
|
||||
window.history.pushState(null, "", url.toString());
|
||||
}
|
||||
|
||||
constructor() {
|
||||
this._list = document.getElementById("invites") as HTMLDivElement;
|
||||
this.empty = true;
|
||||
|
||||
Reference in New Issue
Block a user