@@ -28,6 +28,7 @@ import _ from 'lodash'
28
28
vm . isPageDirty = isPageDirty
29
29
vm . isTracksDirty = isTracksDirty
30
30
vm . isCommunitySelected = isCommunitySelected
31
+ vm . isPageStateDirty = false
31
32
///////
32
33
activate ( )
33
34
@@ -42,20 +43,22 @@ import _ from 'lodash'
42
43
/**
43
44
* Verfies if the page state has been modified by the user in any way.
44
45
*/
45
- function isPageDirty ( ) {
46
+ function isPageDirty ( ) {
46
47
return isTracksDirty ( ) || isCommunitiesDirty ( )
47
48
}
48
49
49
50
/**
50
51
* Verfies if the tracks section state has been modified by the user in any way.
51
52
*/
52
53
function isTracksDirty ( ) {
54
+ vm . isPageStateDirty = true
53
55
return vm . tracks . DESIGN || vm . tracks . DEVELOP || vm . tracks . DATA_SCIENCE
54
56
}
55
57
/**
56
58
* Verfies if the communities section state has been modified by the user in any way.
57
59
*/
58
60
function isCommunitySelected ( ) {
61
+ vm . isPageStateDirty = true
59
62
var community = _ . find ( vm . communities , { status : true , display : true } )
60
63
return ! ! community
61
64
}
@@ -131,9 +134,8 @@ import _ from 'lodash'
131
134
if ( program ) {
132
135
var community = _ . find ( vm . communities , { programId : program . eventId } )
133
136
if ( community ) {
134
- // set display false to avoid showing already enabled/registered program
135
- // we expect display property to be modified after first load of the page
136
- // community.status = true
137
+ // Show existing communites selected
138
+ community . status = true
137
139
if ( community . unregister ) {
138
140
community . unregister ( )
139
141
_addWatchToCommunity ( community )
0 commit comments