File tree Expand file tree Collapse file tree
Sources/CodeiumService/ChatTab Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ let package = Package(
4444 . package ( url: " https://github.com/pointfreeco/swift-dependencies " , from: " 1.0.0 " ) ,
4545 . package (
4646 url: " https://github.com/pointfreeco/swift-composable-architecture " ,
47- exact: " 1.10.4 "
47+ exact: " 1.15.0 "
4848 ) ,
4949 // quick hack to support custom UserDefaults
5050 // https://github.com/sindresorhus/KeyboardShortcuts
Original file line number Diff line number Diff line change @@ -134,7 +134,7 @@ public class ChatGPTChatTab: ChatTab {
134134 }
135135 } . store ( in: & cancellable)
136136
137- do {
137+ Task { @ MainActor in
138138 var lastTrigger = - 1
139139 observer. observe { [ weak self] in
140140 guard let self else { return }
@@ -147,7 +147,7 @@ public class ChatGPTChatTab: ChatTab {
147147 }
148148 }
149149
150- do {
150+ Task { @ MainActor in
151151 var lastTitle = " "
152152 observer. observe { [ weak self] in
153153 guard let self else { return }
@@ -160,14 +160,16 @@ public class ChatGPTChatTab: ChatTab {
160160 }
161161 }
162162
163- observer. observe { [ weak self] in
164- guard let self else { return }
165- _ = chat. history
166- _ = chat. title
167- _ = chat. isReceivingMessage
168- Task {
169- await self . updateContentDebounce. debounce { @MainActor [ weak self] in
170- self ? . chatTabStore. send ( . tabContentUpdated)
163+ Task { @MainActor in
164+ observer. observe { [ weak self] in
165+ guard let self else { return }
166+ _ = chat. history
167+ _ = chat. title
168+ _ = chat. isReceivingMessage
169+ Task {
170+ await self . updateContentDebounce. debounce { @MainActor [ weak self] in
171+ self ? . chatTabStore. send ( . tabContentUpdated)
172+ }
171173 }
172174 }
173175 }
Original file line number Diff line number Diff line change @@ -65,9 +65,9 @@ let package = Package(
6565 . package ( url: " https://github.com/intitni/Highlightr " , branch: " master " ) ,
6666 . package (
6767 url: " https://github.com/pointfreeco/swift-composable-architecture " ,
68- exact: " 1.10.4 "
68+ exact: " 1.15.0 "
6969 ) ,
70- . package ( url: " https://github.com/apple/swift-syntax.git " , exact: " 509 .0.2 " ) ,
70+ . package ( url: " https://github.com/apple/swift-syntax.git " , exact: " 600 .0.0 " ) ,
7171 . package ( url: " https://github.com/GottaGetSwifty/CodableWrappers " , from: " 2.0.7 " ) ,
7272 // A fork of https://github.com/google/generative-ai-swift to support setting base url.
7373 . package (
Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ public class CodeiumChatTab: ChatTab {
8585 chatTabStore. send ( . updateTitle( " Codeium Chat " ) )
8686 store. send ( . initialize)
8787
88- do {
88+ Task { @ MainActor in
8989 var previousURL : URL ?
9090 observer. observe { [ weak self] in
9191 guard let self else { return }
@@ -98,11 +98,13 @@ public class CodeiumChatTab: ChatTab {
9898 }
9999 }
100100
101- observer. observe { [ weak self] in
102- guard let self, !store. title. isEmpty else { return }
103- let title = store. title
104- Task { @MainActor in
105- self . chatTabStore. send ( . updateTitle( title) )
101+ Task { @MainActor in
102+ observer. observe { [ weak self] in
103+ guard let self, !store. title. isEmpty else { return }
104+ let title = store. title
105+ Task { @MainActor in
106+ self . chatTabStore. send ( . updateTitle( title) )
107+ }
106108 }
107109 }
108110 }
@@ -143,7 +145,7 @@ public class CodeiumChatTab: ChatTab {
143145 [ Builder ( title: " Codeium Chat " ) ]
144146 }
145147
146- public static func defaultChatBuilder( ) -> ChatTabBuilder {
148+ public static func defaultChatBuilder( ) -> ChatTabBuilder {
147149 Builder ( title: " Codeium Chat " )
148150 }
149151}
You can’t perform that action at this time.
0 commit comments