File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -104,6 +104,10 @@ public class ChatGPTChatTab: ChatTab {
104104
105105 return [ Builder ( title: " New Chat " , customCommand: nil ) ] + customCommands
106106 }
107+
108+ public static func defaultBuilder( ) -> ChatTabBuilder {
109+ Builder ( title: " New Chat " , customCommand: nil )
110+ }
107111
108112 @MainActor
109113 public init ( service: ChatService = . init( ) , store: StoreOf < ChatTabItem > ) {
Original file line number Diff line number Diff line change @@ -388,12 +388,7 @@ extension ChatTabPool {
388388 ) async -> ( any ChatTab , ChatTabInfo ) ? {
389389 let id = UUID ( ) . uuidString
390390 let info = ChatTabInfo ( id: id, title: " " )
391- guard let builder = kind? . builder else {
392- let chatTap = ChatGPTChatTab ( store: createStore ( id) )
393- setTab ( chatTap)
394- return ( chatTap, info)
395- }
396-
391+ let builder = kind? . builder ?? ChatGPTChatTab . defaultBuilder ( )
397392 guard let chatTap = await builder. build ( store: createStore ( id) ) else { return nil }
398393 setTab ( chatTap)
399394 return ( chatTap, info)
You can’t perform that action at this time.
0 commit comments