chore: speedup channel switching

Correctly clear the chat input

We enable/disable the chat input on various occasions (switching
channels, communities, checking for the person being a contact, etc.).
When we do so, we clear the text of the input which causes all sorts of
internal handlers to get fired, namely the `onTextChanged` part which
parses the text, emojis etc... which is very time consuming. More fixes
here in the followup commits; but by using `clear()` it's much faster,
resets correctly the internal state and also doesn't fire when the input
had been empty already before. Found with QML profiler
This commit is contained in:
Lukáš Tinkl 2023-04-05 12:29:25 +02:00 committed by Lukáš Tinkl
parent 6385afebaf
commit 5dbc08dca3
1 changed files with 1 additions and 1 deletions

View File

@ -1342,7 +1342,7 @@ Rectangle {
onEnabledChanged: { onEnabledChanged: {
if (!enabled) { if (!enabled) {
text = "" clear()
control.hideExtendedArea() control.hideExtendedArea()
} }
} }