diff --git a/src/renderer/components/platform-bible-toolbar.tsx b/src/renderer/components/platform-bible-toolbar.tsx index 9d2d39b581..ba74e9e84c 100644 --- a/src/renderer/components/platform-bible-toolbar.tsx +++ b/src/renderer/components/platform-bible-toolbar.tsx @@ -1,5 +1,7 @@ import useSetting from '@renderer/hooks/papi-hooks/use-setting.hook'; +import logger from '@shared/services/logger.service'; import { Toolbar, RefSelector, ScriptureReference, Button } from 'platform-bible-react'; +import { Localized, MultiColumnMenu } from 'platform-bible-utils'; import { handleMenuCommand } from './platform-bible-menu.commands'; import provideMenuData from './platform-bible-menu.data'; @@ -9,6 +11,22 @@ const defaultScrRef: ScriptureReference = { verseNum: 1, }; +/** + * Providing empty menu data if the software fails to load fully so we can shift click the menu and + * click Reload Extensions if it fails the first time + * + * @param isSupportAndDevelopment + * @returns + */ +async function getMenuData(isSupportAndDevelopment: boolean): Promise> { + try { + return await provideMenuData(isSupportAndDevelopment); + } catch (e) { + logger.error(`Could not get platform-bible-toolbar menu data! ${e}`); + return { columns: {}, groups: {}, items: [] }; + } +} + export default function PlatformBibleToolbar() { const [scrRef, setScrRef, resetScrRef] = useSetting('platform.verseRef', defaultScrRef); @@ -17,7 +35,7 @@ export default function PlatformBibleToolbar() { }; return ( - +