diff --git a/scripts/utils/console-style.js b/scripts/utils/console-style.js index ae7e29b79..433a36202 100644 --- a/scripts/utils/console-style.js +++ b/scripts/utils/console-style.js @@ -11,7 +11,7 @@ export const ANSI = { export function shouldUseColor() { if (process.env.NO_COLOR !== undefined) return false; if (process.env.FORCE_COLOR && process.env.FORCE_COLOR !== '0') return true; - return Boolean(process.stdout.isTTY); + return process.stdout.isTTY; } export function styleText(text, color, enabled) { diff --git a/src/app/components/media/Image.tsx b/src/app/components/media/Image.tsx index e9e39634d..7c01e1372 100644 --- a/src/app/components/media/Image.tsx +++ b/src/app/components/media/Image.tsx @@ -107,9 +107,7 @@ export function processAndSanitizeLottie(root: unknown): string | null { } } else if (value && typeof value === 'object') { const entries = Object.entries(value as Record).filter( - ([k, child]) => - !UNSAFE_LOTTIE_KEYS.has(k) && - !(k === 'x' && typeof child === 'string') + ([k, child]) => !UNSAFE_LOTTIE_KEYS.has(k) && !(k === 'x' && typeof child === 'string') ); for (const [k, child] of entries) { @@ -129,7 +127,9 @@ export function processAndSanitizeLottie(root: unknown): string | null { } for (let i = entries.length - 1; i >= 0; i--) { - const [k, child] = entries[i]; + const entry = entries[i]; + if (!entry) continue; + const [k, child] = entry; stack.push({ parent: newObj, key: k, value: child, depth: depth + 1 }); } } else { @@ -183,7 +183,7 @@ async function readBytes( chunks.push(value); } } finally { - if (!completed) await reader.cancel().catch(() => undefined); + if (!completed) await reader.cancel().catch(() => {}); reader.releaseLock(); } @@ -215,9 +215,9 @@ async function resolveLottieJson(src: string, signal: AbortSignal): Promise { + useEffect((): (() => void) | undefined => { if (!player) { setForwardedRef(null); - return; + return undefined; } const canvas = player.canvas as HTMLCanvasElement; diff --git a/src/app/pages/client/space/Space.tsx b/src/app/pages/client/space/Space.tsx index 74a632104..744530b5e 100644 --- a/src/app/pages/client/space/Space.tsx +++ b/src/app/pages/client/space/Space.tsx @@ -98,8 +98,6 @@ import { ModalWide } from '$styles/Modal.css'; import { ImageViewer } from '$components/image-viewer'; import { reportMediaLoadFailure } from '$utils/mediaLoadDiagnostics'; import * as css from './styles.css'; -import { isResizingSidebarAtom } from '$state/isResizingSidebar'; -import { UserQuickTools } from '../sidebar/UserQuickTools'; import { Image as MediaImage } from '$components/media'; import { useRenderableMediaUrl } from '$hooks/useRenderableMediaUrl'; import { ModalOverlay } from '$components/modal-overlay/ModalOverlay';