Skip to content

Commit

Permalink
[Misc] Fix bug: chat message can be sent to the wrong game.
Browse files Browse the repository at this point in the history
- https://forums.online-go.com/t/surround-ios-client-for-ogs/34437/159
- Weird behavior in deprecated `onCommit` property.
  • Loading branch information
honganhkhoa committed Mar 3, 2024
1 parent 4ae6395 commit bf9f0a7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions Surround/Components/ChatLog.swift
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,12 @@ struct NewChatInput: View {
}
TextField(
malkovich ? "Note to yourself" : "Say hi!",
text: $newChat,
onCommit: sendChat
text: $newChat
)
.submitLabel(.send)
.onSubmit {
self.sendChat()
}
if self.chatSendingCancellable == nil {
Button(action: sendChat) {
Image(systemName: "arrow.up.circle.fill")
Expand Down
2 changes: 1 addition & 1 deletion Surround/Views/GameDetail/GameDetailView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ struct GameDetailView: View {
#if os(iOS)
compactLayout = horizontalSizeClass == .compact
#endif
var navigationBarHidden = (attachedKeyboardVisible && !compactLayout) || zenMode
let navigationBarHidden = (attachedKeyboardVisible && !compactLayout) || zenMode
var title = currentGame.gameName
if currentGame.isUserPlaying, let userColor = currentGame.userStoneColor, let opponent = currentGame.currentPlayer(with: userColor.opponentColor()) {
title = "vs \(opponent.username) [\(opponent.formattedRank)]"
Expand Down

0 comments on commit bf9f0a7

Please sign in to comment.