aboutsummaryrefslogtreecommitdiff
path: root/modern/src/common
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-06-04 09:13:49 -0700
committerAnton Tananaev <anton@traccar.org>2022-06-04 09:13:49 -0700
commit71c5dfe153705bc6ee1931920f7713e73284115f (patch)
tree1ac2e3d9e4c383f210cc62d9d92f83b7e0b363df /modern/src/common
parent022718d7d0831c246bbe01cc2d8fb66709be3189 (diff)
downloadtrackermap-web-71c5dfe153705bc6ee1931920f7713e73284115f.tar.gz
trackermap-web-71c5dfe153705bc6ee1931920f7713e73284115f.tar.bz2
trackermap-web-71c5dfe153705bc6ee1931920f7713e73284115f.zip
Filtering and sorting (fix #952)
Diffstat (limited to 'modern/src/common')
-rw-r--r--modern/src/common/theme/dimensions.js6
-rw-r--r--modern/src/common/util/usePersistedState.js6
2 files changed, 5 insertions, 7 deletions
diff --git a/modern/src/common/theme/dimensions.js b/modern/src/common/theme/dimensions.js
index d68a94f5..c5974ec3 100644
--- a/modern/src/common/theme/dimensions.js
+++ b/modern/src/common/theme/dimensions.js
@@ -1,6 +1,4 @@
export default {
- inputHeight: '42px',
- borderRadius: '4px',
sidebarWidth: '28%',
sidebarWidthTablet: '52px',
drawerWidthDesktop: '360px',
@@ -8,10 +6,6 @@ export default {
drawerHeightPhone: '250px',
filterFormWidth: '160px',
bottomBarHeight: 56,
- columnWidthDate: 160,
- columnWidthNumber: 130,
- columnWidthString: 160,
- columnWidthBoolean: 130,
popupMapOffset: 300,
popupMaxWidth: 272,
};
diff --git a/modern/src/common/util/usePersistedState.js b/modern/src/common/util/usePersistedState.js
index 8bc4401f..70a652ad 100644
--- a/modern/src/common/util/usePersistedState.js
+++ b/modern/src/common/util/usePersistedState.js
@@ -11,7 +11,11 @@ export default (key, defaultValue) => {
});
useEffect(() => {
- savePersistedState(key, value);
+ if (value !== defaultValue) {
+ savePersistedState(key, value);
+ } else {
+ window.localStorage.removeItem(key);
+ }
}, [key, value]);
return [value, setValue];