File tree Expand file tree Collapse file tree 5 files changed +9
-11
lines changed Expand file tree Collapse file tree 5 files changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -121,8 +121,8 @@ export class AppComponent implements OnInit {
121
121
// this.getRelatedVideos();
122
122
} else {
123
123
this . setDefaultPlayer ( ) ;
124
+ this . shared . getSettings ( ) ;
124
125
}
125
- this . shared . getSettings ( ) ;
126
126
} ) ;
127
127
}
128
128
Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ export class CategoryComponent implements OnInit {
23
23
) {
24
24
// INIT SETTINGS
25
25
this . shared . getSettings ( ) ;
26
- this . shared . setSettings ( ) ;
27
26
}
28
27
29
28
ngOnInit ( ) {
Original file line number Diff line number Diff line change @@ -69,11 +69,11 @@ export class SettingsComponent implements OnInit {
69
69
this . globals . internal_settings [ i ] . value = data . settings [ i ] ;
70
70
} ) ;
71
71
this . globals . settings . form_settings = this . globals . internal_settings ;
72
- this . shared . updateSettings ( ) ;
73
- this . shared . setSettings ( ) ;
74
72
75
- this . app . checkVolumeRange ( ) ;
73
+ this . shared . updateLocalStorageSettings ( ) ;
74
+ this . shared . getSettings ( ) ;
76
75
76
+ this . app . checkVolumeRange ( ) ;
77
77
this . shared . triggerNotify ( 'Changed' ) ;
78
78
} ) ;
79
79
}
@@ -86,7 +86,6 @@ export class SettingsComponent implements OnInit {
86
86
}
87
87
88
88
getDefaultSettings ( ) {
89
- this . shared . getSettings ( ) ;
90
89
this . globals . internal_settings = this . globals . settings . form_settings ;
91
90
this . globals . external_settings = this . globals . settings . api_settings ;
92
91
this . initExternalForm ( ) ;
@@ -104,9 +103,8 @@ export class SettingsComponent implements OnInit {
104
103
this . globals . settings . api_settings = this . globals . external_settings ;
105
104
this . globals . feedVideos = null ;
106
105
107
- this . shared . updateSettings ( ) ;
106
+ this . shared . updateLocalStorageSettings ( ) ;
108
107
this . shared . getSettings ( ) ;
109
- this . shared . setSettings ( ) ;
110
108
111
109
this . category . getFeedVideos ( ) ;
112
110
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ export class SharedService {
46
46
} else {
47
47
this . globals . settings = JSON . parse ( localStorage . getItem ( 'settings' ) ) ;
48
48
}
49
+ this . setSettings ( ) ;
49
50
}
50
51
51
52
setSettings ( ) {
@@ -62,6 +63,7 @@ export class SharedService {
62
63
}
63
64
64
65
async initFeed ( ) {
66
+ await this . getSettings ( ) ;
65
67
const res = await this . youtube . feedVideos ( ) ;
66
68
this . convertVideoObject ( res [ 'items' ] , 'feedVideos' ) ;
67
69
}
@@ -75,7 +77,7 @@ export class SharedService {
75
77
console . log ( state ) ;
76
78
}
77
79
78
- updateSettings ( ) {
80
+ updateLocalStorageSettings ( ) {
79
81
localStorage . setItem ( 'settings' , JSON . stringify ( this . globals . settings ) ) ;
80
82
this . setLocalVersion ( ) ;
81
83
}
@@ -91,7 +93,7 @@ export class SharedService {
91
93
92
94
setLocalVersion ( ) {
93
95
if ( localStorage . getItem ( 'version' ) === null ) {
94
- localStorage . setItem ( 'version' , '2 ' ) ;
96
+ localStorage . setItem ( 'version' , '1 ' ) ;
95
97
}
96
98
}
97
99
Original file line number Diff line number Diff line change @@ -54,7 +54,6 @@ export class YoutubeGetVideo {
54
54
}
55
55
56
56
async categories ( ) {
57
- console . log ( 'intra aici' ) ;
58
57
if ( this . globals . apiKey ) {
59
58
const res = await this . http . get ( `${ this . url } videoCategories?part=snippet®ionCode=${ this . globals . regionCode } &key=${ this . globals . apiKey } ` )
60
59
. map ( response => response ) . toPromise ( ) ;
You can’t perform that action at this time.
0 commit comments