Fix version detection

Version check failed when the server sent something other than a number
as a version as happened on development version of the gotosocial
server.
pull/298/head
K 2023-01-19 09:32:45 +01:00 zatwierdzone przez GitHub
rodzic 0a6543d355
commit 4f9391f015
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -336,7 +336,8 @@ class TUI(urwid.Frame):
# this works for Mastodon and Pleroma version strings
# Mastodon versions < 4 do not have translation service
# Revisit this logic if Pleroma implements translation
self.can_translate = int(instance["version"][0]) > 3
ch = instance["version"][0]
self.can_translate = int(ch) > 3 if ch.isnumeric() else False
return self.run_in_thread(_load_instance, done_callback=_done)