mirror of
https://github.com/jambonz/jambonz-webapp.git
synced 2026-10-24 04:14:22 +00:00
Feature/persist state (#191)
* persist SP implementation * add account filter check after refresh * store recent calls and alerts filter --------- Co-authored-by: EgleHelms <e.helms@cognigy.com>
This commit is contained in:
1 parent
51c2285bfb
commit
af3e724240
17 files changed
+184
-6
No files matched your search
@@ -26,6 +26,7 @@ import type {
|
||||
UserScopes,
|
||||
} from "src/api/types";
|
||||
import type { UserData } from "src/store/types";
|
||||
import { getQueryFilter } from "src/store/localStore";
|
||||
|
||||
export const hasValue = <Type>(
|
||||
variable: Type | null | undefined
|
||||
@@ -211,6 +212,19 @@ export const filterScopeOptions = (
|
||||
return optionArray;
|
||||
};
|
||||
|
||||
export const createFilterString = (filterValue: string, label: string) => {
|
||||
const filterString = getQueryFilter().split("/");
|
||||
|
||||
if (label === "Date") {
|
||||
filterString.splice(0, 0, filterValue);
|
||||
} else if (label === "Direction") {
|
||||
filterString.splice(1, 1, filterValue);
|
||||
} else if (label === "Status") {
|
||||
filterString.splice(2, 2, filterValue);
|
||||
}
|
||||
return filterString.join("/");
|
||||
};
|
||||
|
||||
export {
|
||||
withSuspense,
|
||||
useMobileMedia,
|
||||
|
||||
Reference in new issue
Block a user