Skip to content

Commit

Permalink
chore: disable tab creation/profile buttons before tabs have loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
jessebofill committed Jan 21, 2024
1 parent c03862f commit 6d4d09e
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/components/QuickAccessContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,20 +107,20 @@ export const QuickAccessContent: VFC<{}> = ({ }) => {
<Field className="no-sep">
<Focusable style={{ width: "100%", display: "flex" }}>
<Focusable className="add-tab-btn" style={{ width: "calc(100% - 50px)" }}>
<DialogButton onClick={() => showModalNewTab(tabMasterManager)} onOKActionDescription={'Add Tab'}>
<DialogButton disabled={!tabMasterManager.hasSettingsLoaded} onClick={() => showModalNewTab(tabMasterManager)} onOKActionDescription={'Add Tab'}>
Add Tab
</DialogButton>
</Focusable>
{tabMasterManager.hasSettingsLoaded &&
<Focusable className="add-tab-btn" style={{ marginLeft: "10px" }}>
<DialogButton
style={{ height: '40px', width: '42px', minWidth: 0, padding: '10px 12px', marginLeft: 'auto', display: "flex", justifyContent: "center", alignItems: "center", marginRight: "8px" }}
onOKActionDescription={'Add Quick Tab'}
onClick={() => showContextMenu(<PresetMenu tabMasterManager={tabMasterManager} isMicroSDeckInstalled={isMicroSDeckInstalled} />)}
>
<PiListPlusBold size='1.4em' />
</DialogButton>
</Focusable>}
<Focusable className="add-tab-btn" style={{ marginLeft: "10px" }}>
<DialogButton
disabled={!tabMasterManager.hasSettingsLoaded}
style={{ height: '40px', width: '42px', minWidth: 0, padding: '10px 12px', marginLeft: 'auto', display: "flex", justifyContent: "center", alignItems: "center", marginRight: "8px" }}
onOKActionDescription={'Add Quick Tab'}
onClick={() => showContextMenu(<PresetMenu tabMasterManager={tabMasterManager} isMicroSDeckInstalled={isMicroSDeckInstalled} />)}
>
<PiListPlusBold size='1.4em' />
</DialogButton>
</Focusable>
</Focusable>
</Field>
<PanelSection title="Tabs">
Expand Down Expand Up @@ -186,6 +186,7 @@ export const QuickAccessTitleView: VFC<QuickAccessTitleViewProps> = ({ title, ta
>
<div style={{ marginRight: "auto" }}>{title}</div>
<DialogButton
disabled={!tabMasterManager.hasSettingsLoaded}
onOKActionDescription="Manage Tab Profiles"
style={buttonStyle}
onClick={() => showContextMenu(<TabProfilesMenu tabMasterManager={tabMasterManager} />)}
Expand Down

0 comments on commit 6d4d09e

Please sign in to comment.