diff --git a/polylan_submitter/src/Clock.vue b/polylan_submitter/src/Clock.vue index a234731..c39faad 100644 --- a/polylan_submitter/src/Clock.vue +++ b/polylan_submitter/src/Clock.vue @@ -3,14 +3,12 @@ import { computed } from "vue"; import { useI18n } from "vue-i18n"; import { useTitle } from "@vueuse/core"; import { useClockSocket } from "@/composables/useClockSocket"; -import { provideEventPath } from "@/composables/useEventPath"; interface Props { eventPath: string; } const props = defineProps(); -provideEventPath(props.eventPath); const { t } = useI18n(); useTitle(computed(() => t("clock.pageTitle"))); @@ -26,7 +24,7 @@ const { cooldownRemainingMs, cooldownDurationSeconds, press, -} = useClockSocket(); +} = useClockSocket(props.eventPath); const remainingDisplay = computed(() => { const totalSeconds = Math.floor(remainingMs.value / 1000); diff --git a/polylan_submitter/src/Place.vue b/polylan_submitter/src/Place.vue index 532904c..431217d 100644 --- a/polylan_submitter/src/Place.vue +++ b/polylan_submitter/src/Place.vue @@ -3,7 +3,6 @@ import { computed, onMounted, ref, watch } from "vue"; import { useI18n } from "vue-i18n"; import { useTitle } from "@vueuse/core"; import { usePlaceSocket } from "@/composables/usePlaceSocket"; -import { provideEventPath } from "@/composables/useEventPath"; import { PALETTE } from "@/palette"; interface Props { @@ -11,7 +10,6 @@ interface Props { } const props = defineProps(); -provideEventPath(props.eventPath); const { t } = useI18n(); useTitle(computed(() => t("place.pageTitle"))); @@ -48,7 +46,7 @@ const { gridWidth, gridHeight, place, -} = usePlaceSocket(drawPixel); +} = usePlaceSocket(props.eventPath, drawPixel); const overlayWidth = computed(() => gridWidth.value * PX_PER_CELL); const overlayHeight = computed(() => gridHeight.value * PX_PER_CELL); diff --git a/polylan_submitter/src/composables/useClockSocket.ts b/polylan_submitter/src/composables/useClockSocket.ts index 38a70d3..8f0ce93 100644 --- a/polylan_submitter/src/composables/useClockSocket.ts +++ b/polylan_submitter/src/composables/useClockSocket.ts @@ -1,7 +1,6 @@ import { computed, onBeforeUnmount, onMounted, ref } from 'vue' import { useWebSocket } from '@vueuse/core' import { clockApiMyStats } from '@/api' -import { useEventPath } from './useEventPath' // Mirrors clock/wire.py: a one-letter type tag then '|'-separated fields, in a // fixed order the server always uses. See that file for the message table. @@ -10,9 +9,7 @@ import { useEventPath } from './useEventPath' // "not logged in" branch to handle here. const RECONNECT_DELAY_MS = 1000 -export function useClockSocket() { - const eventPath = useEventPath() - +export function useClockSocket(eventPath: string) { const endTimeMs = ref(null) const offsetMs = ref(0) const remainingMs = ref(0) diff --git a/polylan_submitter/src/composables/usePlaceSocket.ts b/polylan_submitter/src/composables/usePlaceSocket.ts index 099d896..e233c5b 100644 --- a/polylan_submitter/src/composables/usePlaceSocket.ts +++ b/polylan_submitter/src/composables/usePlaceSocket.ts @@ -1,7 +1,6 @@ import { computed, onBeforeUnmount, onMounted, ref } from 'vue' import { useWebSocket } from '@vueuse/core' import { placeApiCanvas } from '@/api' -import { useEventPath } from './useEventPath' // Mirrors place/wire.py: a one-letter type tag then '|'-separated fields, in // a fixed order the server always uses. See that file for the message table. @@ -27,9 +26,7 @@ let grid = new Uint8Array(DEFAULT_GRID_SIZE * DEFAULT_GRID_SIZE) const gridWidth = ref(DEFAULT_GRID_SIZE) const gridHeight = ref(DEFAULT_GRID_SIZE) -export function usePlaceSocket(onPixel?: OnPixel, onResize?: OnResize) { - const eventPath = useEventPath() - +export function usePlaceSocket(eventPath: string, onPixel?: OnPixel, onResize?: OnResize) { const cooldownEndMs = ref(null) const cooldownRemainingMs = ref(0)