Styles: Inline findDocuments as it won't be used anywhere else

This commit is contained in:
Sqaaakoi 2025-02-12 00:51:49 +13:00
parent 73e5110f6c
commit 799ae1593b
No known key found for this signature in database

View file

@ -33,11 +33,6 @@ export function requireStyle(name: string) {
return style; 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 * 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 * @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 * @see {@link setStyleVariables} for more info on style classnames
*/ */
export function compileStyle(style: Style) { 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));
} }
/** /**