Skip to content

Commit 3eea0ab

Browse files
queadquead
authored andcommitted
1.9.1 - Creating function for get and set settings to localstorage
1 parent 8af6698 commit 3eea0ab

File tree

7 files changed

+39
-47
lines changed

7 files changed

+39
-47
lines changed

dist/inline.bundle.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/main.bundle.js

Lines changed: 14 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/main.bundle.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/app.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ export class AppComponent implements OnInit {
281281
this.displayVideoPlayer = true;
282282
this._shared.settings.form_settings[2].value = true;
283283
}
284+
this._shared.updateSettings();
284285
}
285286
if (int === 1) {
286287
if (this.repeatMode) {
@@ -290,6 +291,7 @@ export class AppComponent implements OnInit {
290291
this.repeatMode = true;
291292
this._shared.settings.form_settings[3].value = true;
292293
}
294+
this._shared.updateSettings();
293295
}
294296
if (int === 2) {
295297
if (this.currentMuteState) {

src/app/components/youtube-history.component.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
</div>
44
<div class="app-content">
55
<div class="history-video-content">
6-
<div *ngIf="historyVideos.length === 0" class="video-list-info">
7-
No history
8-
</div>
9-
<div *ngFor="let historyVideo of historyVideos; let i = index" [attr.data-index]="i" class="video-item" (click)="onClickHistory($event, i)">
10-
<div *ngIf="thumbnails" class="video-item-image">
11-
<img src="{{ historyVideo.thumbnail }}" alt="history video thumbnail" />
6+
<div *ngIf="historyVideos.length === 0" class="video-list-info">
7+
No history
128
</div>
13-
<div class="video-item-content">
14-
<p>{{ historyVideo.title }}</p>
9+
<div *ngFor="let historyVideo of historyVideos; let i = index" [attr.data-index]="i" class="video-item" (click)="onClickHistory($event, i)">
10+
<div *ngIf="thumbnails" class="video-item-image">
11+
<img src="{{ historyVideo.thumbnail }}" alt="history video thumbnail" />
12+
</div>
13+
<div class="video-item-content">
14+
<p>{{ historyVideo.title }}</p>
15+
</div>
1516
</div>
1617
</div>
17-
</div>
1818
</div>

src/app/components/youtube-settings.component.ts

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ export class SettingsComponent implements OnInit {
6868
});
6969
this._app.setSettings(this.settings, 0);
7070
this._search.setSettings(this.settings, 1);
71-
this.notifySettings();
71+
this._shared.form_settings = this.settings;
72+
this._shared.triggerNotify('Changed');
73+
this.updateNotify();
7274
});
7375
}
7476

@@ -97,23 +99,11 @@ export class SettingsComponent implements OnInit {
9799
this._shared.setApiSettings();
98100
this._shared.feedVideos = null;
99101
this._app.getSettings();
100-
this._app.getFeedVideos();
101-
this.notifySettings();
102+
this._shared.triggerNotify('Changed');
103+
this.updateNotify();
102104
setTimeout(() => this.loadingRegion = false, 500);
103105
}
104106

105-
notifySettings() {
106-
if (!this.notify.enabled) {
107-
this._shared.triggerNotify('Changed');
108-
this.updateNotify();
109-
} else {
110-
setTimeout(() => {
111-
this._shared.triggerNotify('Changed');
112-
this.updateNotify();
113-
}, 1000);
114-
}
115-
}
116-
117107
updateNotify() {
118108
this.notify = this._shared.notify;
119109
setTimeout(() => this.notify = this._shared.notify, 1000);

0 commit comments

Comments
 (0)