in dashboard/new-dashboard/src/components/common/PersistentStateManager.ts [73:95]
private updateUrlQuery() {
if (this.router == null) {
return
}
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const currentRoute = this.route!
const query: LocationQueryRaw = { ...currentRoute.query }
let isChanged = false
for (const [name, value] of Object.entries(this.state)) {
if (((name !== "serverUrl" && typeof value === "string") || Array.isArray(value) || value === null) && (isChanged || query[name] !== value)) {
// Persist empty arrays as `[]` to allow 0-value selections shared via the URL to override a user's local state.
query[name] = Array.isArray(value) && value.length === 0 ? "[]" : value
isChanged = true
}
}
const filteredQuery = Object.fromEntries(Object.entries(query).filter(([key]) => [...this.knownKeys, pointParamName].includes(key)))
if (isChanged) {
// noinspection JSIgnoredPromiseFromCall
void this.router.push({ query: filteredQuery })
}
}