File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8181 }
8282
8383 if ( result && result . data && ! angular . equals ( { } , result . data ) && result . id ) {
84+ if ( ! result . data . design ) result . data . design = $scope . data . design ;
8485 $scope . data = result . data ;
8586 $scope . id = result . id ;
8687 if ( $scope . data . content && $scope . data . content . carouselImages )
142143 return ;
143144 }
144145
146+ if ( ! newObj . content || ! newObj . design )
147+ return ;
148+
145149 buildfire . datastore . save ( newObj , function ( err , result ) {
146150 if ( err || ! result ) {
147151 console . error ( 'Error saving the widget details: ' , err ) ;
Original file line number Diff line number Diff line change 7373 }
7474
7575 if ( result && result . data && ! angular . equals ( { } , result . data ) ) {
76+ if ( ! result . data . design ) result . data . design = $scope . data . design ;
7677 $scope . data = result . data ;
7778 $scope . id = result . id ;
7879 }
111112 return ;
112113 }
113114
115+ if ( ! newObj . content || ! newObj . design )
116+ return ;
117+
114118 buildfire . datastore . save ( newObj , function ( err , result ) {
115119 if ( err || ! result ) {
116120 console . error ( 'Error saving the widget details: ' , err ) ;
Original file line number Diff line number Diff line change @@ -54,12 +54,14 @@ function init() {
5454 state . data = result . data && result . data . content
5555 ? result . data
5656 : defaultData ;
57+ ! state . data . design ? state . data . design = defaultData . design : null ;
5758 render ( ) ;
5859 } ) ;
5960
6061 // Keep state up to date with control changes
6162 buildfire . datastore . onUpdate ( ( result ) => {
6263 state . data = result . data ;
64+ ! state . data . design ? state . data . design = defaultData . design : null ;
6365 render ( ) ;
6466 } ) ;
6567}
You can’t perform that action at this time.
0 commit comments