From 0e190fca2a546ab53dea246c2fcf820afd3c518b Mon Sep 17 00:00:00 2001 From: Tzahi12345 Date: Mon, 24 Apr 2023 19:28:52 -0400 Subject: [PATCH] Ghost file card count are now per-sub --- src/app/components/recent-videos/recent-videos.component.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/components/recent-videos/recent-videos.component.ts b/src/app/components/recent-videos/recent-videos.component.ts index c7e716f..0edcdb9 100644 --- a/src/app/components/recent-videos/recent-videos.component.ts +++ b/src/app/components/recent-videos/recent-videos.component.ts @@ -76,8 +76,9 @@ export class RecentVideosComponent implements OnInit { constructor(public postsService: PostsService, private router: Router) { // get cached file count - if (localStorage.getItem('cached_file_count')) { - this.cached_file_count = +localStorage.getItem('cached_file_count') <= 10 ? +localStorage.getItem('cached_file_count') : 10; + const sub_id_appendix = this.sub_id ? `_${this.sub_id}` : '' + if (localStorage.getItem(`cached_file_count${sub_id_appendix}`)) { + this.cached_file_count = +localStorage.getItem(`cached_file_count${sub_id_appendix}`) <= 10 ? +localStorage.getItem(`cached_file_count${sub_id_appendix}`) : 10; this.loading_files = Array(this.cached_file_count).fill(0); }