add style strict

This commit is contained in:
FullGreaM 2026-04-26 23:56:43 +03:00
parent 99daa282d6
commit 2cd12c828f
2 changed files with 6 additions and 0 deletions

View File

@ -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();

View File

@ -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);
}
}