Commit 261553b4 authored by Leonardo Aramaki's avatar Leonardo Aramaki

Revert removed urls when saving tokens

parent 24a9b0a5
...@@ -155,7 +155,7 @@ class RocketChatApplication : Application(), HasActivityInjector, HasServiceInje ...@@ -155,7 +155,7 @@ class RocketChatApplication : Application(), HasActivityInjector, HasServiceInje
} }
val account = Account(url, icon, logo, user.username!!, avatar) val account = Account(url, icon, logo, user.username!!, avatar)
launch(CommonPool) { launch(CommonPool) {
tokenRepository.save(Token(userId!!, authToken)) tokenRepository.save(url, Token(userId!!, authToken))
accountRepository.save(account) accountRepository.save(account)
} }
} }
...@@ -214,14 +214,14 @@ class RocketChatApplication : Application(), HasActivityInjector, HasServiceInje ...@@ -214,14 +214,14 @@ class RocketChatApplication : Application(), HasActivityInjector, HasServiceInje
getCurrentServerInteractor.get()?.let { serverUrl -> getCurrentServerInteractor.get()?.let { serverUrl ->
multiServerRepository.get(serverUrl)?.let { token -> multiServerRepository.get(serverUrl)?.let { token ->
tokenRepository.save(Token(token.userId, token.authToken)) tokenRepository.save(serverUrl, Token(token.userId, token.authToken))
} }
} }
runBlocking { runBlocking {
getAccountsInteractor.get().forEach { account -> getAccountsInteractor.get().forEach { account ->
multiServerRepository.get(account.serverUrl)?.let { token -> multiServerRepository.get(account.serverUrl)?.let { token ->
tokenRepository.save(token.toToken()) tokenRepository.save(account.serverUrl, token.toToken())
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment