Skip to content

Commit e1d491d

Browse files
committed
fix(hub-ui): align dock restoration types and events
1 parent 00e2bdb commit e1d491d

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎packages/hub-ui/src/client/state/context.test.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { DevframeDockEntry } from '@devframes/hub'
22
import type { DevframeRpcClient, DockSessionStorage } from '@devframes/hub/client'
33
import type { SharedState } from 'devframe/utils/shared-state'
4+
import { DEVFRAME_EVENTS } from 'devframe/constants'
45
import { createEventEmitter } from 'devframe/utils/events'
56
import { createSharedState } from 'devframe/utils/shared-state'
67
import { describe, expect, it, vi } from 'vitest'
@@ -61,7 +62,7 @@ function createStubRpc() {
6162
sharedStates,
6263
trust() {
6364
isTrusted = true
64-
events.emit('rpc:is-trusted:updated', true)
65+
events.emit(DEVFRAME_EVENTS.client.isTrustedUpdated, true)
6566
},
6667
}
6768
}

‎packages/hub-ui/src/client/state/context.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import type { Ref } from 'vue'
66
import type { DevframeDocksUserSettings } from './dock-settings'
77
import { attachFrameNavClient, createDockRenderersContext } from '@devframes/hub/client'
88
import { DEFAULT_STATE_USER_SETTINGS, DOCK_RENDERERS_STATE_KEY, HUB_EVENTS } from '@devframes/hub/constants'
9+
import { DEVFRAME_EVENTS } from 'devframe/constants'
910
import { computed, markRaw, reactive, ref, toRefs, watch, watchEffect } from 'vue'
1011
import { BUILTIN_ENTRIES, BUILTIN_ENTRY_SETTINGS, DEFAULT_CATEGORIES_ORDER, HUB_UI_HIDE_EVENT } from '../constants'
1112
import { useBranding } from './branding'
@@ -621,7 +622,7 @@ export async function createDocksContext(
621622
if (rpc.isTrusted)
622623
return
623624
await new Promise<void>((resolve) => {
624-
const stopListening = rpc.events.on('rpc:is-trusted:updated', (isTrusted) => {
625+
const stopListening = rpc.events.on(DEVFRAME_EVENTS.client.isTrustedUpdated, (isTrusted) => {
625626
if (!isTrusted)
626627
return
627628
stopListening()

‎packages/hub-ui/src/client/state/docks.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export function sharedStateToRef<T>(sharedState: SharedState<T>): ShallowRef<T>
8888
return ref
8989
}
9090

91-
export function waitForInitialSharedStateSync<Value>(
91+
export function waitForInitialSharedStateSync<Value extends object>(
9292
sharedState: SharedState<Value>,
9393
pendingValue: Value,
9494
): Promise<void> {

0 commit comments

Comments
 (0)