@@ -79,7 +79,7 @@ export default class WorkspacesStore extends FeatureStore {
7979
8080 // ========== PUBLIC API ========= //
8181
82- start ( stores , actions ) {
82+ @ action start ( stores , actions ) {
8383 debug ( 'WorkspacesStore::start' ) ;
8484 this . stores = stores ;
8585 this . actions = actions ;
@@ -104,7 +104,7 @@ export default class WorkspacesStore extends FeatureStore {
104104 // REACTIONS
105105
106106 this . _freeUserReactions = createReactions ( [
107- this . _stopPremiumActionsAndReactions ,
107+ this . _disablePremiumFeatures ,
108108 this . _openDrawerWithSettingsReaction ,
109109 this . _setFeatureEnabledReaction ,
110110 this . _setIsPremiumFeatureReaction ,
@@ -123,17 +123,21 @@ export default class WorkspacesStore extends FeatureStore {
123123 this . isFeatureActive = true ;
124124 }
125125
126- stop ( ) {
127- super . stop ( ) ;
128- debug ( 'WorkspacesStore::stop' ) ;
129- this . isFeatureActive = false ;
126+ @action reset ( ) {
130127 this . activeWorkspace = null ;
131128 this . nextWorkspace = null ;
132129 this . workspaceBeingEdited = null ;
133130 this . isSwitchingWorkspace = false ;
134131 this . isWorkspaceDrawerOpen = false ;
135132 }
136133
134+ @action stop ( ) {
135+ super . stop ( ) ;
136+ debug ( 'WorkspacesStore::stop' ) ;
137+ this . reset ( ) ;
138+ this . isFeatureActive = false ;
139+ }
140+
137141 filterServicesByActiveWorkspace = ( services ) => {
138142 const { activeWorkspace, isFeatureActive } = this ;
139143 if ( isFeatureActive && activeWorkspace ) {
@@ -281,6 +285,7 @@ export default class WorkspacesStore extends FeatureStore {
281285 } ;
282286
283287 _activateLastUsedWorkspaceReaction = ( ) => {
288+ debug ( '_activateLastUsedWorkspaceReaction' ) ;
284289 if ( ! this . activeWorkspace && this . userHasWorkspaces ) {
285290 const { lastActiveWorkspace } = this . settings ;
286291 if ( lastActiveWorkspace ) {
@@ -324,10 +329,12 @@ export default class WorkspacesStore extends FeatureStore {
324329 } ) ;
325330 } ;
326331
327- _stopPremiumActionsAndReactions = ( ) => {
332+ _disablePremiumFeatures = ( ) => {
328333 if ( ! this . isUserAllowedToUseFeature ) {
334+ debug ( '_disablePremiumFeatures' ) ;
329335 this . _stopActions ( this . _premiumUserActions ) ;
330336 this . _stopReactions ( this . _premiumUserReactions ) ;
337+ this . reset ( ) ;
331338 } else {
332339 this . _startActions ( this . _premiumUserActions ) ;
333340 this . _startReactions ( this . _premiumUserReactions ) ;
0 commit comments