Merge pull request #667 from 3flex/remove-setBackdropPeriodMs
Some checks are pending
Lint / Lint TS and CSS (push) Waiting to run
Publish / Build (push) Waiting to run
Publish / Publish (push) Blocked by required conditions
Publish / Deploy (push) Blocked by required conditions
Test / Jest (push) Waiting to run

Remove unused function setBackdropPeriodMs
This commit is contained in:
Niels van Velzen 2024-11-03 14:00:29 +01:00 committed by GitHub
commit c36bc05b1d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;
@ -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
@ -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.