Skip to content

Commit 84cfdd1

Browse files
committed
fixup! web: Fix issues which prevent timestamps from refreshing.
1 parent b91f224 commit 84cfdd1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

web/src/elements/timestamp/ak-timestamp.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ import { ifPresent } from "#elements/utils/attributes";
77
import { html, nothing, PropertyValues } from "lit";
88
import { customElement, property } from "lit/decorators.js";
99

10+
/**
11+
* @deprecated Remove after #18296 is merged.
12+
*/
13+
const reducedMotionMediaQueryList = window.matchMedia("(prefers-reduced-motion: reduce)");
14+
1015
@customElement("ak-timestamp")
1116
export class AKTimestamp extends AKElement {
1217
static UpdateInterval = 1000 * 60;
@@ -91,7 +96,7 @@ export class AKTimestamp extends AKElement {
9196
// allowing the elapsed time to at first update every second for the first minute,
9297
// then every minute afterwards.
9398

94-
if (startWithinInterval) {
99+
if (startWithinInterval && !reducedMotionMediaQueryList.matches) {
95100
this.#interval = self.setInterval(() => {
96101
if (!this.visible || document.visibilityState !== "visible") return;
97102

0 commit comments

Comments
 (0)