From a4937f4bb40833f298b4de24087200ba05cfb967 Mon Sep 17 00:00:00 2001 From: ASIjacket <26643085+ASIjacket@users.noreply.github.com> Date: Wed, 27 May 2026 18:36:10 +0900 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=AE=80=E6=98=93=E9=98=85?= =?UTF-8?q?=E8=AF=BB=E6=A8=A1=E5=BC=8F=E5=A4=B1=E6=95=88=E9=97=AE=E9=A2=98?= =?UTF-8?q?=20#339?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes https://github.com/hymbz/ComicReadScript/issues/339 --- src/userscript/otherSite/index.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/userscript/otherSite/index.tsx b/src/userscript/otherSite/index.tsx index 5ef44a0f..0bca4c83 100644 --- a/src/userscript/otherSite/index.tsx +++ b/src/userscript/otherSite/index.tsx @@ -164,10 +164,11 @@ export const otherSite = async () => { }, time); /** 按照元素的显示高度来排序元素 */ - const sortElementsByTop = (elements: T[]): T[] => { + const sortElementsByTop = (elements: Iterable,): T[] => { + const list = [...elements]; const topMap = new WeakMap(); - for (const e of elements) topMap.set(e, e.getBoundingClientRect().top); - return elements.toSorted((a, b) => topMap.get(a)! - topMap.get(b)!); + for (const e of list) topMap.set(e, e.getBoundingClientRect().top); + return list.toSorted((a, b) => topMap.get(a)! - topMap.get(b)!); }; const imageWatcher = new ImageWatcher({