Skip to content

Commit

Permalink
fix issues
Browse files Browse the repository at this point in the history
  • Loading branch information
holgerkoser committed Dec 12, 2024
1 parent 17ed53c commit c8f256f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
5 changes: 0 additions & 5 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,20 @@ import {
provide,
inject,
toRef,
watch,
computed,
} from 'vue'
import { useTheme } from 'vuetify'
import {
onKeyStroke,
useEventBus,
useColorMode,
useDocumentVisibility,
useTitle,
} from '@vueuse/core'
import { useRoute } from 'vue-router'

import { useConfigStore } from '@/store/config'
import { useLoginStore } from '@/store/login'
import { useLocalStorageStore } from '@/store/localStorage'
import { useShootStore } from '@/store/shoot'
import { useProjectStore } from '@/store/project'

import { useCustomColors } from '@/composables/useCustomColors'
Expand All @@ -38,10 +35,8 @@ import get from 'lodash/get'
const theme = useTheme()
const route = useRoute()
const localStorageStore = useLocalStorageStore()
const visibility = useDocumentVisibility()
const configStore = useConfigStore()
const loginStore = useLoginStore()
const shootStore = useShootStore()
const projectStore = useProjectStore()
const logger = inject('logger')

Expand Down
3 changes: 1 addition & 2 deletions frontend/src/composables/useSocketEventHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,13 @@ export function useSocketEventHandler (useStore, options = {}) {
throttledHandleEvents = wait > 0
? throttle(boundHandleEvents, wait)
: boundHandleEvents
return this
return throttledHandleEvents
}

function stop () {
cancelTrailingInvocation()
eventMap.clear()
throttledHandleEvents = undefined
return this
}

function listener (event) {
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/store/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ export const useProjectStore = defineStore('project', () => {

const socketEventHandler = useSocketEventHandler(useProjectStore, {
logger,
}).start(500)
})
socketEventHandler.start(500)

async function $reset () {
list.value = null
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/store/shoot/shoot.js
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ const useShootStore = defineStore('shoot', () => {
const shootStore = this
shootStore.$patch(({ state }) => {
setSubscriptionState(state, constants.OPENING)
socketEventHandler.start(throttleDelay)
state.subscriptionEventHandler = socketEventHandler.start(throttleDelay)
})
try {
await socketStore.emitSubscribe(value)
Expand All @@ -579,6 +579,7 @@ const useShootStore = defineStore('shoot', () => {
state.subscription = null
setSubscriptionState(state, constants.CLOSING)
socketEventHandler.stop()
state.subscriptionEventHandler = undefined
})
try {
await socketStore.emitUnsubscribe()
Expand All @@ -593,7 +594,7 @@ const useShootStore = defineStore('shoot', () => {
return includes(activeUids.value, uid)
}

const socketEventHandler = useSocketEventHandler('shoots', {
const socketEventHandler = useSocketEventHandler(useShootStore, {
logger,
createOperator ({ state }) {
const notOnlyShootsWithIssues = !onlyAllShootsWithIssues(state, context)
Expand Down

0 comments on commit c8f256f

Please sign in to comment.