diff --git a/src/components/ExporterButtons.vue b/src/components/ExporterButtons.vue index b7cb55c6..36860ec9 100644 --- a/src/components/ExporterButtons.vue +++ b/src/components/ExporterButtons.vue @@ -44,7 +44,7 @@ const uploadBody = computed(() => { state: state.toJSON(), 'ji-lattice': jiLattice.toJSON(), grid: grid.toJSON(), - 'edo-cycles': cycles.toJSON(), + 'edo-cycles': cycles.toJSON() }, envelope: makeEnvelope(state.shareStatistics) }) diff --git a/src/stores/edo-cycles.ts b/src/stores/edo-cycles.ts index 8b9ea826..918a466d 100644 --- a/src/stores/edo-cycles.ts +++ b/src/stores/edo-cycles.ts @@ -27,7 +27,7 @@ export const useCyclesStore = defineStore('edo-cycles', () => { labelOffset, showLabels, valString, - generator, + generator } /** diff --git a/src/stores/grid.ts b/src/stores/grid.ts index d1a7e0e4..15cafbf5 100644 --- a/src/stores/grid.ts +++ b/src/stores/grid.ts @@ -265,7 +265,7 @@ export const useGridStore = defineStore('grid', () => { gridlines1, gridlines2, diagonals1, - diagonals2, + diagonals2 } /** @@ -279,15 +279,15 @@ export const useGridStore = defineStore('grid', () => { return result } -/** - * Apply revived state to current state. - * @param data JSON data as an Object instance. - */ -function fromJSON(data: any) { - for (const key in LIVE_STATE) { - LIVE_STATE[key as keyof typeof LIVE_STATE].value = data[key] + /** + * Apply revived state to current state. + * @param data JSON data as an Object instance. + */ + function fromJSON(data: any) { + for (const key in LIVE_STATE) { + LIVE_STATE[key as keyof typeof LIVE_STATE].value = data[key] + } } -} return { // State @@ -309,6 +309,6 @@ function fromJSON(data: any) { autoTonnetz, // sw-server toJSON, - fromJSON, + fromJSON } }) diff --git a/src/stores/ji-lattice.ts b/src/stores/ji-lattice.ts index 18033244..f7bbf0ba 100644 --- a/src/stores/ji-lattice.ts +++ b/src/stores/ji-lattice.ts @@ -285,26 +285,26 @@ export const useJiLatticeStore = defineStore('ji-lattice', () => { rotation, drawArrows, grayExtras, - depth, + depth } /** * Convert live state to a format suitable for storing on the server. */ - function toJSON() { - const result: any = { - horizontalCoordinates, - verticalCoordinates, - xCoords, - yCoords, - zCoords, - } - for (const [key, value] of Object.entries(LIVE_STATE)) { - result[key] = value.value - } - return result + function toJSON() { + const result: any = { + horizontalCoordinates, + verticalCoordinates, + xCoords, + yCoords, + zCoords } - + for (const [key, value] of Object.entries(LIVE_STATE)) { + result[key] = value.value + } + return result + } + /** * Apply revived state to current state. * @param data JSON data as an Object instance. @@ -354,6 +354,6 @@ export const useJiLatticeStore = defineStore('ji-lattice', () => { yaw, roll, toJSON, - fromJSON, + fromJSON } }) diff --git a/src/stores/state.ts b/src/stores/state.ts index fe5b49f7..46b63f2b 100644 --- a/src/stores/state.ts +++ b/src/stores/state.ts @@ -54,7 +54,7 @@ export const useStateStore = defineStore('state', () => { * Convert live state to a format suitable for storing on the server. */ function toJSON() { - return {latticeType: latticeType.value} + return { latticeType: latticeType.value } } /** diff --git a/src/views/LoadScaleView.vue b/src/views/LoadScaleView.vue index 3141e568..5e4d8620 100644 --- a/src/views/LoadScaleView.vue +++ b/src/views/LoadScaleView.vue @@ -42,8 +42,7 @@ onMounted(async () => { } else { try { // XXX: Dashes are not filesystem friendly, but that's a problem for sw-server to solve. - // XXX: The api should probably be extensionless now that compression negotation makes sw-server bypassing much harder. - const res = await fetch(new URL(`scale/${id}.json.gz`, API_URL)) + const res = await fetch(new URL(`scale/${id}`, API_URL)) if (res.ok) { text.value = 'Scale loaded. Redirecting...' const body = await res.text()