@@ -71,23 +71,30 @@ angular.module('sm').controller("AppController", function($scope, localStorage,
7171
7272 // Reload the state if it exists
7373 var storedState = localStorage . getItem ( 'state' ) ;
74- if ( storedState != null ) {
75-
74+ if ( storedState != null ) {
7675 // Check if state version exists or is correct
77- if ( storedState . hasOwnProperty ( 'meta' ) && storedState . meta . stateVersion == $scope . stateVersion ) {
76+ if ( storedState . hasOwnProperty ( 'meta' ) && storedState . meta . stateVersion == $scope . stateVersion ) {
7877 $scope . state = storedState ;
79- if ( ! $scope . state . displayOptions . hasOwnProperty ( 'creditWarning' ) || ! $scope . state . displayOptions . creditWarning ) {
78+ if ( ! $scope . state . displayOptions . hasOwnProperty ( 'creditWarning' ) || ! $scope . state . displayOptions . creditWarning ) {
8079 $scope . state . displayOptions . creditWarning = 18 ;
8180 }
82- if ( $scope . state . schedules . length > 0 && $scope . state . schedules [ 0 ] . length > 0 && ! $scope . state . schedules [ 0 ] [ 0 ] . hasOwnProperty ( 'initialIndex' ) ) {
81+
82+ // Initialize new values
83+ if ( $scope . state . schedules . length > 0 && $scope . state . schedules [ 0 ] . length > 0 && ! $scope . state . schedules [ 0 ] [ 0 ] . hasOwnProperty ( 'initialIndex' ) ) {
8384 for ( var count = 0 ; count < $scope . state . schedules . length ; count ++ ) {
8485 $scope . state . schedules [ count ] [ 0 ] . initialIndex = count ;
8586 }
8687 }
88+ if ( ! $scope . state . classDetails ) {
89+ $scope . state . classDetails = 'NPL' ;
90+ }
91+ if ( ! $scope . state . theme ) {
92+ $scope . state . theme = 'woc' ;
93+ }
8794 } else {
8895
8996 // Before state meta
90- if ( confirm ( 'We need to clear your session in order to update ScheduleMaker, is that ok? \n If you press cancel, you may run into errors.' ) ) {
97+ if ( confirm ( 'We need to clear your session in order to update ScheduleMaker, is that ok? \n If you press cancel, you may run into errors.' ) ) {
9198 $scope . resetState ( ) ;
9299 } else {
93100 $scope . state = storedState ;
@@ -103,7 +110,6 @@ angular.module('sm').controller("AppController", function($scope, localStorage,
103110 // Default, images are supported
104111 $scope . imageSupport = true ;
105112
106-
107113 var courseNumFilter = $filter ( 'courseNum' ) ;
108114
109115 // Course cart tools for non-generate pages.
0 commit comments