@@ -7,33 +7,40 @@ import options from './navbar.config';
77
88export default class PublicCloudController {
99 /* @ngInject */
10- constructor ( $scope , $window , ovhUserPref , WalkMe ) {
10+ constructor ( $scope , $timeout , $ window, ovhUserPref , WalkMe ) {
1111 this . $scope = $scope ;
12- this . $window = $window ;
1312 this . feedbackUrl = __FEEDBACK_URL__ ;
1413 this . feedback = feedback ;
1514 this . ovhUserPref = ovhUserPref ;
1615 this . WalkMe = WalkMe ;
1716
18-
1917 this . navbarOptions = options ;
2018
21- $scope . $on ( 'navbar.loaded' , ( ) => this . ovhUserPref . getValue ( KEY )
22- . then ( ( { value } ) => {
23- this . shouldShowWalkMe = value ;
24- } )
25- . catch ( ( { status } ) => {
26- if ( status === 404 ) {
27- this . shouldShowWalkMe = true ;
28- }
29- } )
30- . finally ( ( ) => {
31- // TODO : Remove matchMedia for mobile version
32- if ( this . shouldShowWalkMe && $window . matchMedia ( `(min-width: ${ BREAKPOINT } px)` ) . matches ) {
33- this . tour = this . WalkMe . start ( ) ;
34- angular . element ( 'oui-navbar' ) . on ( 'click' , ( ) => this . endWalkMe ( ) ) ;
35- }
36- } ) ) ;
19+ $scope . $on ( 'navbar.loaded' , ( ) => $timeout ( ( ) => {
20+ this . shouldShowWalkMe = ( localStorage . getItem ( KEY ) || true ) && $window . matchMedia ( `(min-width: ${ BREAKPOINT } px)` ) . matches ;
21+ if ( this . shouldShowWalkMe ) {
22+ this . tour = this . WalkMe . start ( ) ;
23+ angular . element ( 'oui-navbar' ) . on ( 'click' , ( ) => this . endWalkMe ( ) ) ;
24+ }
25+ } ) ) ;
26+
27+ // this.ovhUserPref.getValue(KEY)
28+ // .then(({ value }) => {
29+ // this.shouldShowWalkMe = value;
30+ // })
31+ // .catch(({ status }) => {
32+ // if (status === 404) {
33+ // this.shouldShowWalkMe = true;
34+ // }
35+ // })
36+ // .finally(() => {
37+ // // TODO : Remove matchMedia for mobile version
38+ // if (this.shouldShowWalkMe
39+ // && $window.matchMedia(`(min-width: ${BREAKPOINT}px)`).matches) {
40+ // this.tour = this.WalkMe.start();
41+ // angular.element('oui-navbar').on('click', () => this.endWalkMe());
42+ // }
43+ // }));
3744 }
3845
3946 endWalkMe ( ) {
0 commit comments