Skip to content

Commit 86bad54

Browse files
authored
Merge pull request #408 from devtron-labs/fix/persist-url-filters
fix: do not set in local storage for undefined
2 parents 9f6262d + b2e9d8a commit 86bad54

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtron-labs/devtron-fe-common-lib",
3-
"version": "1.0.9",
3+
"version": "1.0.10",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Common/Hooks/useUrlFilters/useUrlFilters.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ const useUrlFilters = <T = string, K = unknown>({
161161
}
162162

163163
useEffect(() => {
164+
if (!localStorageKey) {
165+
return
166+
}
164167
// if we have search string, set secondary params in local storage accordingly
165168
if (location.search) {
166169
setItemInLocalStorageIfKeyExists(localStorageKey, JSON.stringify(parsedParams))

0 commit comments

Comments
 (0)