File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed
WordPress/src/main/java/org/wordpress/android/ui/sitecreation/services Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -111,17 +111,22 @@ class NewSiteCreationService : AutoForeground<NewSiteCreationServiceState>(NewSi
111111 retryFromState : NewSiteCreationServiceState ? ,
112112 data : NewSiteCreationServiceData
113113 ) {
114- clearSiteCreationServiceState()
114+ val currentState = AutoForeground .getState(NewSiteCreationServiceState ::class .java)
115+ if (currentState == null || currentState.step == FAILURE ) {
116+ clearSiteCreationServiceState()
115117
116- val intent = Intent (context, NewSiteCreationService ::class .java)
118+ val intent = Intent (context, NewSiteCreationService ::class .java)
117119
118- intent.putExtra(ARG_DATA , data)
120+ intent.putExtra(ARG_DATA , data)
119121
120- if (retryFromState != null ) {
121- intent.putExtra(ARG_RESUME_PHASE , retryFromState.stepName)
122- }
122+ if (retryFromState != null ) {
123+ intent.putExtra(ARG_RESUME_PHASE , retryFromState.stepName)
124+ }
123125
124- context.startService(intent)
126+ context.startService(intent)
127+ } else {
128+ AppLog .w(T .SITE_CREATION , " Service not started - it seems it's already running." )
129+ }
125130 }
126131
127132 fun clearSiteCreationServiceState () {
You can’t perform that action at this time.
0 commit comments