Skip to content

Commit

Permalink
NextJS check on settings.environment in applyTheme
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtelnov committed Jul 17, 2023
1 parent 29f4fd9 commit cff6f6c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/stylesmanager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ export class StylesManager {
return themeMapper;
}
static getIncludedThemeCss(): Array<any> {
if (typeof settings.environment === "undefined") return [];
const { rootElement }: ISurveyEnvironment = settings.environment;
const themeMapper = StylesManager.getAvailableThemes();

Expand Down Expand Up @@ -324,6 +325,7 @@ export class StylesManager {
}

public static applyTheme(themeName: string = "default", themeSelector?: string): void {
if (typeof settings.environment === "undefined") return;
const { rootElement }: ISurveyEnvironment = settings.environment;
const element = isShadowDOM(rootElement) ? rootElement.host : rootElement;
surveyCss.currentType = themeName;
Expand Down

0 comments on commit cff6f6c

Please sign in to comment.