Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
a43b7c89
Commit
a43b7c89
authored
Mar 28, 2018
by
Lucio Maciel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Save to TokenRepository and guard with try/catch
parent
15bbe966
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
RocketChatApplication.kt
...ain/java/chat/rocket/android/app/RocketChatApplication.kt
+9
-3
No files found.
app/src/main/java/chat/rocket/android/app/RocketChatApplication.kt
View file @
a43b7c89
...
...
@@ -91,7 +91,14 @@ class RocketChatApplication : Application(), HasActivityInjector, HasServiceInje
setupCrashlytics
()
setupFresco
()
setupTimber
()
migrateFromLegacy
()
// TODO - remove this and all realm stuff when we got to 80% in 2.0
try
{
migrateFromLegacy
()
}
catch
(
ex
:
Exception
)
{
Timber
.
d
(
ex
,
"Error migrating old accounts"
)
ex
.
printStackTrace
()
}
}
private
fun
migrateFromLegacy
()
{
...
...
@@ -144,8 +151,7 @@ class RocketChatApplication : Application(), HasActivityInjector, HasServiceInje
}
val
account
=
Account
(
url
,
icon
,
logo
,
user
.
username
!!
,
avatar
)
launch
(
CommonPool
)
{
val
tokenModel
=
TokenModel
(
userId
!!
,
authToken
)
multiServerRepository
.
save
(
url
,
tokenModel
)
tokenRepository
.
save
(
url
,
Token
(
userId
!!
,
authToken
))
accountRepository
.
save
(
account
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment