Skip to content

Commit

Permalink
Merge pull request #9141 from wordpress-mobile/issue/9138-invalid-sit…
Browse files Browse the repository at this point in the history
…e-creation-state

Fix issue - NewSiteCreationService can enter invalid state
  • Loading branch information
oguzkocer authored Jan 30, 2019
2 parents 812855d + 1314598 commit 825abd0
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ import org.wordpress.android.util.LocaleManager
import java.util.HashMap
import javax.inject.Inject

class NewSiteCreationService : AutoForeground<NewSiteCreationServiceState>(NewSiteCreationServiceState(IDLE)),
private val INITIAL_STATE = IDLE

class NewSiteCreationService : AutoForeground<NewSiteCreationServiceState>(NewSiteCreationServiceState(INITIAL_STATE)),
NewSiteCreationServiceManagerListener {
@Inject lateinit var manager: NewSiteCreationServiceManager

Expand Down Expand Up @@ -98,7 +100,7 @@ class NewSiteCreationService : AutoForeground<NewSiteCreationServiceState>(NewSi
data: NewSiteCreationServiceData
) {
val currentState = AutoForeground.getState(NewSiteCreationServiceState::class.java)
if (currentState == null || currentState.step == FAILURE) {
if (currentState == null || currentState.step == INITIAL_STATE || currentState.step == FAILURE) {
clearSiteCreationServiceState()

val intent = Intent(context, NewSiteCreationService::class.java)
Expand Down

0 comments on commit 825abd0

Please sign in to comment.