app/src/main/java/com/geekorum/ttrss/accounts/LoginViewModel.kt
changeset 712 fc75653c8faf
parent 611 91b8d76c03cd
child 749 c6e765b4a10c
equal deleted inserted replaced
711:8f906cbbcea6 712:fc75653c8faf
   203     private suspend fun addAccount(): Account? {
   203     private suspend fun addAccount(): Account? {
   204         return withContext(dispatchers.io) {
   204         return withContext(dispatchers.io) {
   205             val account = Account(username, httpUrl!!.toString())
   205             val account = Account(username, httpUrl!!.toString())
   206             val success = accountManager.addAccount(account, password)
   206             val success = accountManager.addAccount(account, password)
   207             if (success) {
   207             if (success) {
       
   208                 val serverInformation = DataServerInformation(account.url, http_auth_username, http_auth_password)
       
   209                 accountManager.updateServerInformation(account, serverInformation)
   208                 accountManager.initializeAccountSync(account)
   210                 accountManager.initializeAccountSync(account)
   209                 return@withContext account
   211                 return@withContext account
   210             }
   212             }
   211             return@withContext null
   213             return@withContext null
   212         }
   214         }