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:
EgleHandEgleHelms authored and GitHub committed 2023-02-02 09:53:04 -05:00
1 parent 51c2285bfb
commit af3e724240
17 files changed
+184 -6

No files matched your search

+14
View File
@@ -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,