From 2cd12c828f98b1e448f2a6475fe026aa0e543720 Mon Sep 17 00:00:00 2001 From: FullGreaM Date: Sun, 26 Apr 2026 23:56:43 +0300 Subject: [PATCH] add style strict --- frontend/src/main.ts | 1 + frontend/src/pages/default-element.ts | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/frontend/src/main.ts b/frontend/src/main.ts index d429f6f..46349f7 100644 --- a/frontend/src/main.ts +++ b/frontend/src/main.ts @@ -19,6 +19,7 @@ const api : ControllerAPI = new ControllerAPI(); async function authInit() { console.log("User is authenticated"); const newsFeed = await api.getNews(true) as NewsFeed; + newsFeed.style = currentStyle; const appElement = document.getElementById("app"); if (appElement) appElement.innerHTML = newsFeed.build(); diff --git a/frontend/src/pages/default-element.ts b/frontend/src/pages/default-element.ts index 02806c8..3e8bc16 100644 --- a/frontend/src/pages/default-element.ts +++ b/frontend/src/pages/default-element.ts @@ -6,4 +6,9 @@ export abstract class DefaultElement extends GefestElement { constructor(content: (GefestElement | string)[] | string) { super(content); } + + build(isFromStyle?: boolean): string { + if (!this.style) throw new Error("Setup style is required"); + return super.build(isFromStyle); + } } \ No newline at end of file