From 46ced1a9349d8e704c215bf01fe8ea5cf74a289c Mon Sep 17 00:00:00 2001 From: liihuu Date: Mon, 4 Mar 2024 00:22:30 +0800 Subject: [PATCH] fix: eslint error --- src/common/Canvas.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/Canvas.ts b/src/common/Canvas.ts index e2e731058..5f41b70dd 100644 --- a/src/common/Canvas.ts +++ b/src/common/Canvas.ts @@ -67,8 +67,8 @@ export default class Canvas { if (result) { this._resizeObserver = new ResizeObserver((entries: ResizeObserverEntry[]) => { const entry = entries.find((entry: ResizeObserverEntry) => entry.target === this._element) - if (isValid(entry?.devicePixelContentBoxSize?.[0])) { - const size = (entry!.devicePixelContentBoxSize[0])! + const size = entry?.devicePixelContentBoxSize?.[0] + if (isValid(size)) { const width = size.inlineSize const height = size.blockSize if (this._pixelWidth !== width || this._pixelHeight !== height) {