Skip to content
Snippets Groups Projects

Automatically add accounts to a known list after performing the appropriate actions

Merged Jakub Ziebinski requested to merge jziebinski/known-accounts into develop
Compare and Show latest version
2 files
+ 10
16
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -95,18 +95,16 @@ class AccountNameInput(TextInput):
yield self.input
yield self.pretty
def _watch_input_value_change(self) -> None:
if not self._show_known_account:
return
# >>> start workaround for Textual calling validate on input when self.watch is used. Setting validate_on to
# values different from "changed" prevents this.
before = self.input.validate_on
self.input.validate_on = ["blur"]
self.watch(self.input, "value", self._update_account_status)
self.input.validate_on = before
# <<< end workaround
def on_mount(self) -> None:
if self._show_known_account:
# >>> start workaround for Textual calling validate on input when self.watch is used. Setting validate_on to
# values different from "changed" prevents this.
before = self.input.validate_on
self.input.validate_on = ["blur"]
self.watch(self.input, "value", self._update_account_status)
self.input.validate_on = before
# <<< end workaround
def add_account_to_known(self) -> None:
"""Add account to known accounts list if it's valid and not already known."""
Loading