Refactor the way we check for if widget or not to make it easier to mock

This commit is contained in:
Hugh Nimmo-Smith
2024-12-02 11:59:20 +00:00
parent bc2281f7d2
commit 0395e5fdc9
7 changed files with 21 additions and 28 deletions

View File

@@ -181,3 +181,10 @@ export const widget = ((): WidgetHelpers | null => {
return null;
}
})();
/**
* Whether or not we are running as a widget.
*
* @returns true if widget, false if SPA
*/
export const isRunningAsWidget: boolean = !!widget;