Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/ui/preact/navigation_component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export type NavigationComponentProps = {
rebooter: Rebooter;

// Locator to control the device locating.
locator: Locator;
locator: Locator | null;

// Notificator to send notifications.
notificator: Notificator;
Expand Down Expand Up @@ -62,9 +62,11 @@ export class NavigationComponent extends Component<
</label>

<div className="nav-buttons">
<button className="nav-button" onClick={this.handleLocate}>
Locate
</button>
{this.props.locator && (
<button className="nav-button" onClick={this.handleLocate}>
Locate
</button>
)}
<button className="nav-button" onClick={this.handleReboot}>
Reboot
</button>
Expand Down Expand Up @@ -119,7 +121,7 @@ export class NavigationComponent extends Component<
return;
}

const err = await this.props.locator.flip();
const err = await this.props.locator!.flip();
if (err) {
console.error(
"navigation_component: failed to toggle device locating:",
Expand Down
Loading