Skip to content

Commit

Permalink
Remove unused function setBackdropPeriodMs
Browse files Browse the repository at this point in the history
  • Loading branch information
3flex committed Nov 3, 2024
1 parent cfa3de8 commit ea7f0c0
Showing 1 changed file with 1 addition and 30 deletions.
31 changes: 1 addition & 30 deletions src/components/documentManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { DeviceIds, getActiveDeviceId } from './castDevices';
// eslint-disable-next-line @typescript-eslint/no-extraneous-class
export abstract class DocumentManager {
// Duration between each backdrop switch in ms
private static backdropPeriodMs: number | null = 30000;
private static backdropPeriodMs = 30000;
// Timer state - so that we don't start the interval more than necessary
private static backdropTimer: number | null = null;

Expand Down Expand Up @@ -404,13 +404,6 @@ export abstract class DocumentManager {
// avoid running it multiple times
this.clearBackdropInterval();

// skip out if it's disabled
if (!this.backdropPeriodMs) {
this.setWaitingBackdrop(null, null);

return;
}

this.backdropTimer = window.setInterval(
() => DocumentManager.setRandomUserBackdrop(),
this.backdropPeriodMs
Expand All @@ -419,28 +412,6 @@ export abstract class DocumentManager {
await this.setRandomUserBackdrop();
}

/**
* Set interval between backdrop changes, null to disable
* @param period - in milliseconds or null
*/
public static setBackdropPeriodMs(period: number | null): void {
if (period !== this.backdropPeriodMs) {
this.backdropPeriodMs = period;

// If the timer was running, restart it
if (this.backdropTimer !== null) {
// startBackdropInterval will also clear the previous one
this.startBackdropInterval();
}

if (period === null) {
// No backdrop is wanted, and the timer has been cleared.
// This call will remove any present backdrop.
this.setWaitingBackdrop(null, null);
}
}
}

/**
* Set background behind the media player,
* this is shown while the media is loading.
Expand Down

0 comments on commit ea7f0c0

Please sign in to comment.