style(rebuild.ts snapshot.ts): format code

This commit is contained in:
Yun Feng
2026-04-01 12:00:00 +08:00
parent 5fbb459a8e
commit 61074a2303
2 changed files with 8 additions and 5 deletions

View File

@@ -203,12 +203,15 @@ function buildNode(
(node as HTMLElement).style.height = value;
}
if (name === 'rr_mediaCurrentTime') {
(node as HTMLMediaElement).currentTime = n.attributes.rr_mediaCurrentTime as number
(node as HTMLMediaElement).currentTime = n.attributes
.rr_mediaCurrentTime as number;
}
if (name === 'rr_mediaState') {
switch (value) {
case 'played':
(node as HTMLMediaElement).play().catch(e => console.warn("media playback error", e));
(node as HTMLMediaElement)
.play()
.catch((e) => console.warn('media playback error', e));
break;
case 'paused':
(node as HTMLMediaElement).pause();

View File

@@ -363,8 +363,8 @@ function serializeNode(
} = options;
// Only record root id when document object is not the base document
let rootId: number | undefined;
if (((doc as unknown) as INode).__sn) {
const docId = ((doc as unknown) as INode).__sn.id;
if ((doc as unknown as INode).__sn) {
const docId = (doc as unknown as INode).__sn.id;
rootId = docId === 1 ? undefined : docId;
}
switch (n.nodeType) {
@@ -464,7 +464,7 @@ function serializeNode(
attributes.rr_mediaState = (n as HTMLMediaElement).paused
? 'paused'
: 'played';
attributes.rr_mediaCurrentTime = (n as HTMLMediaElement).currentTime
attributes.rr_mediaCurrentTime = (n as HTMLMediaElement).currentTime;
}
// scroll
if ((n as HTMLElement).scrollLeft) {