Disable Connect/Disconnect buttons when not in use
This commit is contained in:
parent
efd71d6989
commit
19d4d2c426
1 changed files with 3 additions and 3 deletions
|
@ -1,7 +1,7 @@
|
|||
import electron from "electron";
|
||||
import React, { useState } from "react";
|
||||
import { Dialog, DialogType, DialogFooter } from "@fluentui/react/lib/Dialog";
|
||||
import { PrimaryButton, DefaultButton } from "@fluentui/react/lib/Button";
|
||||
import { DefaultButton } from "@fluentui/react/lib/Button";
|
||||
import { ThemeProvider, PartialTheme } from "@fluentui/react/lib/Theme";
|
||||
import { ComboBox, IComboBoxOption } from "@fluentui/react/lib/ComboBox";
|
||||
import SerialPort from "serialport";
|
||||
|
@ -92,8 +92,8 @@ const Settings: React.FC<Proptypes> = () => {
|
|||
/>
|
||||
|
||||
<DialogFooter>
|
||||
<PrimaryButton onClick={() => { dispatch(connect()); }} text="Connect" />
|
||||
<DefaultButton onClick={() => { dispatch(disconnect()); }} text="Disconnect" />
|
||||
<DefaultButton primary disabled={selector.serialConnection.status.connected} onClick={() => { dispatch(connect()); }} text="Connect" />
|
||||
<DefaultButton disabled={!selector.serialConnection.status.connected} onClick={() => { dispatch(disconnect()); }} text="Disconnect" />
|
||||
</DialogFooter>
|
||||
</Dialog>
|
||||
</ThemeProvider>
|
||||
|
|
Reference in a new issue