Skip to content

Commit 4fd47c1

Browse files
committed
fix: window size check
1 parent 01c4fa9 commit 4fd47c1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/Ombi/ClientApp/src/app/discover/components/recently-requested-list/recently-requested-list.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,10 @@ export class RecentlyRequestedListComponent implements OnInit, OnDestroy, AfterV
203203
// Fallback heuristic if items not yet rendered
204204
if (!targetCardWidth || targetCardWidth === 0) {
205205
// Get viewport width for responsive heuristics
206-
const viewportWidth = (typeof window !== 'undefined')
207-
? (window.innerWidth || document.documentElement.clientWidth)
206+
const viewportWidth = (typeof globalThis.window !== 'undefined')
207+
? (globalThis.window.innerWidth || globalThis.document.documentElement.clientWidth)
208208
: width; // fallback to component width if window unavailable
209-
targetCardWidth = width <= 768 ? 220 : 420;
209+
targetCardWidth = viewportWidth <= 768 ? 220 : 420;
210210
}
211211
// Guard against pathological values
212212
if (targetCardWidth < 120) { targetCardWidth = 120; }

0 commit comments

Comments
 (0)