Skip to content

Commit

Permalink
fix some issues
Browse files Browse the repository at this point in the history
  • Loading branch information
holgerkoser committed Dec 12, 2024
1 parent c8f256f commit 78bb742
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 12 deletions.
56 changes: 54 additions & 2 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@codemirror/search": "^6.5.6",
"@codemirror/state": "^6.4.1",
"@codemirror/theme-one-dark": "^6.1.2",
"@codemirror/view": "^6.33.0",
"@codemirror/view": "^6.35.3",
"@fontsource/roboto": "^5.0.12",
"@kyvg/vue3-notification": "^3.2.1",
"@lezer/common": "^1.2.1",
Expand Down
12 changes: 5 additions & 7 deletions frontend/src/composables/useSocketEventHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,7 @@ export function createListOperator (list) {
}

export function useSocketEventHandler (useStore, options = {}) {
const kind = useStore.name.replace(/^use([a-zA-Z]+)Store$/, '$1')
const {
singularName = kind.toLowerCase(),
pluralName = singularName + 's',
logger = useLogger(),
socketStore = useSocketStore(),
visibility = useDocumentVisibility(),
Expand All @@ -56,6 +53,7 @@ export function useSocketEventHandler (useStore, options = {}) {
const eventMap = new Map([])

async function handleEvents (store) {
const pluralName = store.$id + 's'
const events = Array.from(eventMap.values())
eventMap.clear()
try {
Expand All @@ -72,7 +70,7 @@ export function useSocketEventHandler (useStore, options = {}) {
const items = await socketStore.synchronize(pluralName, uids)
for (const item of items) {
if (item.kind === 'Status') {
logger.info('Failed to synchronize a single %s: %s', singularName, item.message)
logger.info('Failed to synchronize a single %s: %s', store.$id, item.message)
if (item.code === 404) {
const uid = item.details?.uid
if (uid) {
Expand Down Expand Up @@ -127,10 +125,10 @@ export function useSocketEventHandler (useStore, options = {}) {
cancelTrailingInvocation()
eventMap.clear()
const store = useStore()
const boundHandleEvents = partial(handleEvents, store)
const handleEventsWithParams = partial(handleEvents, store)
throttledHandleEvents = wait > 0
? throttle(boundHandleEvents, wait)
: boundHandleEvents
? throttle(handleEventsWithParams, wait)
: handleEventsWithParams
return throttledHandleEvents
}

Expand Down
31 changes: 29 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,15 @@ __metadata:
languageName: node
linkType: hard

"@codemirror/state@npm:^6.5.0":
version: 6.5.0
resolution: "@codemirror/state@npm:6.5.0"
dependencies:
"@marijn/find-cluster-break": "npm:^1.0.0"
checksum: 10c0/740425d605d7b12524e3abef242a8ca0ea1a17bab97f7583221f89c56b8f2eb236f8a227885e2bb472662b328d2a32b972fbf8543096224711679dfc3a28b492
languageName: node
linkType: hard

"@codemirror/theme-one-dark@npm:^6.1.2":
version: 6.1.2
resolution: "@codemirror/theme-one-dark@npm:6.1.2"
Expand All @@ -549,7 +558,7 @@ __metadata:
languageName: node
linkType: hard

"@codemirror/view@npm:^6.0.0, @codemirror/view@npm:^6.17.0, @codemirror/view@npm:^6.23.0, @codemirror/view@npm:^6.27.0, @codemirror/view@npm:^6.33.0":
"@codemirror/view@npm:^6.0.0, @codemirror/view@npm:^6.17.0, @codemirror/view@npm:^6.23.0, @codemirror/view@npm:^6.27.0":
version: 6.35.2
resolution: "@codemirror/view@npm:6.35.2"
dependencies:
Expand All @@ -560,6 +569,17 @@ __metadata:
languageName: node
linkType: hard

"@codemirror/view@npm:^6.35.3":
version: 6.35.3
resolution: "@codemirror/view@npm:6.35.3"
dependencies:
"@codemirror/state": "npm:^6.5.0"
style-mod: "npm:^4.1.0"
w3c-keyname: "npm:^2.2.4"
checksum: 10c0/aa12c86756360f0ab2cf4b09fca16e5bfb3d32cc99a94a18a12aec84dd3a20f15277fb36d42fc78f803caaa7b93f3fa7382ba47e1d3495fad7166317c60090d8
languageName: node
linkType: hard

"@esbuild/aix-ppc64@npm:0.21.5":
version: 0.21.5
resolution: "@esbuild/aix-ppc64@npm:0.21.5"
Expand Down Expand Up @@ -1111,7 +1131,7 @@ __metadata:
"@codemirror/search": "npm:^6.5.6"
"@codemirror/state": "npm:^6.4.1"
"@codemirror/theme-one-dark": "npm:^6.1.2"
"@codemirror/view": "npm:^6.33.0"
"@codemirror/view": "npm:^6.35.3"
"@fontsource/roboto": "npm:^5.0.12"
"@kyvg/vue3-notification": "npm:^3.2.1"
"@lezer/common": "npm:^1.2.1"
Expand Down Expand Up @@ -1746,6 +1766,13 @@ __metadata:
languageName: node
linkType: hard

"@marijn/find-cluster-break@npm:^1.0.0":
version: 1.0.2
resolution: "@marijn/find-cluster-break@npm:1.0.2"
checksum: 10c0/1a17a60b16083cc5f7ce89d7b7d8aa87ce4099723e3e9e34e229ef2cd8a980e69d481ca8ee90ffedfec5119af1aed581642fb60ed0365e7e90634c81ea6b630f
languageName: node
linkType: hard

"@mdi/font@npm:7.4.47":
version: 7.4.47
resolution: "@mdi/font@npm:7.4.47"
Expand Down

0 comments on commit 78bb742

Please sign in to comment.