Skip to content

Commit 36d0e96

Browse files
committed
🐛 fix TS2367 by moving state mutation into registry
1 parent 75159b8 commit 36d0e96

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

components/Editor.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const resolvedTimeout = computed(() => props.startTimeout ?? deckConfig.value?.s
4646
async function start(): Promise<void> {
4747
const entry = registry!.create(sessionId)
4848
session.value = entry
49-
entry.state = 'STARTING'
49+
registry!.setStarting(sessionId)
5050
5151
try {
5252
const url = await requestStart(

composables/useEditorSession.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ export class SessionRegistry {
1818
return this.sessions.get(id)
1919
}
2020

21+
setStarting(id: string): void {
22+
const entry = this.sessions.get(id)
23+
if (entry) entry.state = 'STARTING'
24+
}
25+
2126
setRunning(id: string, url: string): void {
2227
const entry = this.sessions.get(id)
2328
if (!entry) return

0 commit comments

Comments
 (0)