Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
See what's new at GitLab
4
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
GitFox
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yamko
GitFox
Commits
9e9439d4
Commit
9e9439d4
authored
Jun 03, 2019
by
Konstantin Tskhovrebov
🤖
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix session scope initialization after process death.
parent
cbdacf2a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
11 deletions
+16
-11
app/src/main/java/ru/terrakok/gitlabclient/model/interactor/launch/LaunchInteractor.kt
.../gitlabclient/model/interactor/launch/LaunchInteractor.kt
+10
-7
app/src/main/java/ru/terrakok/gitlabclient/presentation/AppLauncher.kt
...java/ru/terrakok/gitlabclient/presentation/AppLauncher.kt
+5
-4
app/src/main/java/ru/terrakok/gitlabclient/ui/AppActivity.kt
app/src/main/java/ru/terrakok/gitlabclient/ui/AppActivity.kt
+1
-0
No files found.
app/src/main/java/ru/terrakok/gitlabclient/model/interactor/launch/LaunchInteractor.kt
View file @
9e9439d4
...
...
@@ -25,12 +25,15 @@ class LaunchInteractor @Inject constructor(
}
}
fun
signInToSession
():
Boolean
{
val
account
=
sessionRepository
.
getCurrentUserAccount
()
Toothpick
.
closeScope
(
DI
.
SERVER_SCOPE
)
Toothpick
.
openScopes
(
DI
.
APP_SCOPE
,
DI
.
SERVER_SCOPE
)
.
installModules
(
ServerModule
(
account
))
return
account
!=
null
val
hasAccount
:
Boolean
get
()
=
sessionRepository
.
getCurrentUserAccount
()
!=
null
fun
signInToLastSession
()
{
if
(!
Toothpick
.
isScopeOpen
(
DI
.
SERVER_SCOPE
))
{
val
account
=
sessionRepository
.
getCurrentUserAccount
()
Toothpick
.
openScopes
(
DI
.
APP_SCOPE
,
DI
.
SERVER_SCOPE
)
.
installModules
(
ServerModule
(
account
))
}
}
}
\ No newline at end of file
app/src/main/java/ru/terrakok/gitlabclient/presentation/AppLauncher.kt
View file @
9e9439d4
...
...
@@ -13,11 +13,13 @@ class AppLauncher @Inject constructor(
private
val
router
:
Router
)
{
fun
coldStart
()
{
val
isSignedIn
=
launchInteractor
.
signInToSession
()
fun
onLaunch
()
{
launchInteractor
.
signInToLastSession
()
}
fun
coldStart
()
{
val
rootScreen
=
if
(
isSignedIn
)
Screens
.
DrawerFlow
if
(
launchInteractor
.
hasAccount
)
Screens
.
DrawerFlow
else
Screens
.
AuthFlow
if
(
launchInteractor
.
isFirstLaunch
)
{
...
...
@@ -25,6 +27,5 @@ class AppLauncher @Inject constructor(
}
else
{
router
.
newRootScreen
(
rootScreen
)
}
}
}
\ No newline at end of file
app/src/main/java/ru/terrakok/gitlabclient/ui/AppActivity.kt
View file @
9e9439d4
...
...
@@ -56,6 +56,7 @@ class AppActivity : MvpAppCompatActivity() {
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
setTheme
(
R
.
style
.
AppTheme
)
Toothpick
.
inject
(
this
,
Toothpick
.
openScope
(
DI
.
APP_SCOPE
))
appLauncher
.
onLaunch
()
super
.
onCreate
(
savedInstanceState
)
setContentView
(
R
.
layout
.
layout_container
)
...
...
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