Browse Source

geodata: save map feature toggle in local storage

pull/4749/head
flisowna 2 years ago
parent
commit
727e7710b9
  1. 3
      packages/nc-gui/components/smartsheet/sidebar/toolbar/GeodataSwitcher.vue
  2. 6
      packages/nc-gui/composables/useMapViewDataStore.ts

3
packages/nc-gui/components/smartsheet/sidebar/toolbar/GeodataSwitcher.vue

@ -1,6 +1,7 @@
<script setup lang="ts">
async function toggleGeodataFeature() {
function toggleGeodataFeature() {
geodataToggleState.show = !geodataToggleState.show
localStorage.setItem('geodataToggleState', JSON.stringify(geodataToggleState.show))
}
</script>

6
packages/nc-gui/composables/useMapViewDataStore.ts

@ -4,7 +4,11 @@ import type { ColumnType, MapType, PaginatedType, TableType, ViewType } from 'no
import { IsPublicInj, ref, useInjectionState, useMetas, useProject } from '#imports'
import type { Row } from '~/lib'
export const geodataToggleState = reactive({ show: false })
const storedValue = localStorage.getItem('geodataToggleState')
const initialState = storedValue ? JSON.parse(storedValue) : false
export const geodataToggleState = reactive({ show: initialState })
const formatData = (list: Record<string, any>[]) =>
list.map(

Loading…
Cancel
Save