null pointer defense for widgets. log settings.json at startup in console

This commit is contained in:
sawka 2024-07-03 14:44:32 -07:00
parent d892bbc372
commit 741ea2d0ae
2 changed files with 4 additions and 2 deletions

View File

@ -83,7 +83,7 @@ const Widgets = React.memo(() => {
</div>
<div className="widget-label">home</div>
</div>
{settingsConfig.widgets.map((data, idx) => (
{settingsConfig?.widgets?.map((data, idx) => (
<div
className="widget"
onClick={() => handleWidgetSelect(data.blockdef)}

View File

@ -35,7 +35,9 @@ document.addEventListener("DOMContentLoaded", async () => {
const initialTab = await WOS.loadAndPinWaveObject<Tab>(WOS.makeORef("tab", waveWindow.activetabid));
WOS.loadAndPinWaveObject<LayoutNode>(WOS.makeORef("layout", initialTab.layoutNode));
initWS();
globalStore.set(atoms.settingsConfigAtom, await services.FileService.GetSettingsConfig());
const settings = await services.FileService.GetSettingsConfig();
console.log("settings", settings);
globalStore.set(atoms.settingsConfigAtom, settings);
services.ObjectService.SetActiveTab(waveWindow.activetabid); // no need to wait
const reactElem = React.createElement(App, null, null);
const elem = document.getElementById("main");