Skip to content

Commit df2423b

Browse files
committed
Fix that command w is not closing a chat tab
1 parent 8043cd6 commit df2423b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Core/Sources/SuggestionWidget/ChatPanelWindow.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ final class ChatPanelWindow: WidgetWindow {
1212
private let store: StoreOf<ChatPanel>
1313

1414
var minimizeWindow: () -> Void = {}
15-
15+
1616
var isDetached: Bool {
17-
store.withState({$0.isDetached})
17+
store.withState { $0.isDetached }
1818
}
1919

2020
override var defaultCollectionBehavior: NSWindow.CollectionBehavior {
@@ -35,7 +35,7 @@ final class ChatPanelWindow: WidgetWindow {
3535
self.minimizeWindow = minimizeWindow
3636
super.init(
3737
contentRect: .init(x: 0, y: 0, width: 300, height: 400),
38-
styleMask: [.resizable, .titled, .miniaturizable, .fullSizeContentView],
38+
styleMask: [.resizable, .titled, .miniaturizable, .fullSizeContentView, .closable],
3939
backing: .buffered,
4040
defer: false
4141
)
@@ -121,5 +121,9 @@ final class ChatPanelWindow: WidgetWindow {
121121
override func miniaturize(_: Any?) {
122122
minimizeWindow()
123123
}
124+
125+
override func close() {
126+
store.send(.closeActiveTabClicked)
127+
}
124128
}
125129

0 commit comments

Comments
 (0)