From 799ae1593b9ad88e0ad5fffe746d17aaa0262e75 Mon Sep 17 00:00:00 2001 From: Sqaaakoi Date: Wed, 12 Feb 2025 00:51:49 +1300 Subject: [PATCH] Styles: Inline findDocuments as it won't be used anywhere else --- src/api/Styles.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/api/Styles.ts b/src/api/Styles.ts index 78bfcb962..f7bf976f5 100644 --- a/src/api/Styles.ts +++ b/src/api/Styles.ts @@ -33,11 +33,6 @@ export function requireStyle(name: string) { return style; } -function findDocuments() { - const popouts = PopoutWindowStore?.getWindowKeys()?.map(k => PopoutWindowStore?.getWindow(k)?.document) ?? []; - return [document, ...popouts]; -} - /** * A style object can be obtained by importing a stylesheet with `?managed` at the end of the import * @param style The style object or name @@ -188,7 +183,8 @@ export function updateStyleInDocument(style: Style, doc: Document) { * @see {@link setStyleVariables} for more info on style classnames */ export function compileStyle(style: Style) { - findDocuments().forEach(doc => updateStyleInDocument(style, doc)); + const popouts = PopoutWindowStore?.getWindowKeys()?.map(k => PopoutWindowStore?.getWindow(k)?.document) ?? []; + return [document, ...popouts].forEach(doc => updateStyleInDocument(style, doc)); } /**