mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-08-08 06:56:10 +00:00
fix: drop dead autocorrect helper and invalidate trait timer
Periphery flagged shouldDisableAutocorrect after the debounce path switched to appliedAutocorrectDisabled. Also cancel autocorrectTraitTimer on disappear so a pending tick cannot fire after the view is gone.
This commit is contained in:
parent
d1ce261d93
commit
6f43dcadbc
@ -160,17 +160,12 @@ struct ContentComposerView: View {
|
||||
.themedChromePanel(edge: .bottom)
|
||||
.onDisappear {
|
||||
autocompleteDebounceTimer?.invalidate()
|
||||
autocorrectTraitTimer?.invalidate()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private extension ContentComposerView {
|
||||
/// Mirror autocomplete's end-of-string caret: SwiftUI's TextField doesn't
|
||||
/// expose selection, and suggestions already assume the caret is at the end.
|
||||
var shouldDisableAutocorrect: Bool {
|
||||
ComposerAutocorrect.shouldDisable(for: messageText, cursorPosition: messageText.count)
|
||||
}
|
||||
|
||||
/// Debounce trait flips so UIKit isn't asked to reload the keyboard on
|
||||
/// every character while the user is still deciding the token.
|
||||
func scheduleAutocorrectTraitUpdate(for text: String) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user