Skip to content

Commit 8043cd6

Browse files
committed
Fix that a tab can be registered to an empty id
1 parent 1fe0874 commit 8043cd6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Core/Sources/Service/GUI/GraphicalUserInterfaceController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ extension ChatTabPool {
367367
let id = id
368368
let info = ChatTabInfo(id: id, title: "")
369369
guard let chatTap = await builder.build(store: createStore(id)) else { return nil }
370-
setTab(chatTap)
370+
setTab(chatTap, forId: id)
371371
return (chatTap, info)
372372
}
373373

@@ -379,7 +379,7 @@ extension ChatTabPool {
379379
let info = ChatTabInfo(id: id, title: "")
380380
let builder = kind?.builder ?? ChatGPTChatTab.defaultBuilder()
381381
guard let chatTap = await builder.build(store: createStore(id)) else { return nil }
382-
setTab(chatTap)
382+
setTab(chatTap, forId: id)
383383
return (chatTap, info)
384384
}
385385

Tool/Sources/ChatTab/ChatTabPool.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ public final class ChatTabPool {
2222
pool[id]
2323
}
2424

25-
public func setTab(_ tab: any ChatTab) {
26-
pool[tab.id] = tab
25+
public func setTab(_ tab: any ChatTab, forId id: String) {
26+
pool[id] = tab
2727
}
2828

2929
public func removeTab(of id: String) {

0 commit comments

Comments
 (0)