diff options
| author | Andrew Branson <andrew.branson@jolla.com> | 2026-02-10 23:16:37 +0100 |
|---|---|---|
| committer | Andrew Branson <andrew.branson@jolla.com> | 2026-02-10 23:16:37 +0100 |
| commit | 69628390815254297bbd8c95436f6780fa846fae (patch) | |
| tree | df6114043e489bf5d767ac39f0d20636e12cf3a2 /settings/accounts/ui/mastodon.qml | |
| parent | ff1c2efe40bf53c146b4a2e3b5046ae8ecb32264 (diff) | |
Translations fixed and other stuff
Diffstat (limited to 'settings/accounts/ui/mastodon.qml')
| -rw-r--r-- | settings/accounts/ui/mastodon.qml | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/settings/accounts/ui/mastodon.qml b/settings/accounts/ui/mastodon.qml index 758ed9b..3359ce8 100644 --- a/settings/accounts/ui/mastodon.qml +++ b/settings/accounts/ui/mastodon.qml @@ -2,6 +2,7 @@ import QtQuick 2.0 import Sailfish.Silica 1.0 import Sailfish.Accounts 1.0 import com.jolla.settings.accounts 1.0 +import com.jolla.settings.accounts.mastodon 1.0 AccountCreationAgent { id: root @@ -43,6 +44,14 @@ AccountCreationAgent { return oauthHost(apiHost) } + function _fallbackDisplayName(apiHost) { + var display = _displayName(apiHost) + if (display.length > 0) { + return display + } + return _displayName(defaultApiHost) + } + function _showRegistrationError(message, busyPage) { _registering = false accountCreationError(message) @@ -290,10 +299,12 @@ AccountCreationAgent { ? newAccount.defaultCredentialsUserName.toString().trim() : "" var providerDisplayName = root._displayName(apiHost) - if (credentialsUserName.length > 0) { - newAccount.displayName = credentialsUserName - } else if (providerDisplayName.length > 0) { - newAccount.displayName = providerDisplayName + var accountDescription = credentialsUserName.length > 0 + ? credentialsUserName + : root._fallbackDisplayName(apiHost) + if (accountDescription.length > 0) { + newAccount.displayName = accountDescription + newAccount.setConfigurationValue("", "description", accountDescription) } newAccount.setConfigurationValue("", "api/Host", apiHost) |
