Skip to content

Commit b8ae34e

Browse files
committed
Support chat tab self-closing
1 parent daab571 commit b8ae34e

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Core/Sources/SuggestionWidget/FeatureReducers/ChatPanelFeature.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,11 @@ public struct ChatPanelFeature: ReducerProtocol {
218218
state.chatTabGroup.tabInfo.insert(tab, at: to)
219219
return .none
220220

221+
case let .chatTab(id, .close):
222+
return .run { send in
223+
await send(.closeTabButtonClicked(id: id))
224+
}
225+
221226
case .chatTab:
222227
return .none
223228
}

Tool/Sources/ChatTab/ChatTabItem.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public struct ChatTabItem: ReducerProtocol {
2020
case updateTitle(String)
2121
case openNewTab(AnyChatTabBuilder)
2222
case tabContentUpdated
23+
case close
2324
}
2425

2526
public init() {}
@@ -34,6 +35,8 @@ public struct ChatTabItem: ReducerProtocol {
3435
return .none
3536
case .tabContentUpdated:
3637
return .none
38+
case .close:
39+
return .none
3740
}
3841
}
3942
}

0 commit comments

Comments
 (0)