Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwellmlin committed Oct 21, 2023
1 parent 04ae980 commit e85fed6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Immutable, PanelExtensionContext, RenderState } from "@foxglove/studio"
import Alert from "@mui/material/Alert";
import { JsonViewer } from "@textea/json-viewer";
import { useCallback, useEffect, useLayoutEffect, useState } from "react";
import { JSX } from "react/jsx-runtime";
import { createRoot } from "react-dom/client";

type State = {
Expand Down Expand Up @@ -86,8 +87,10 @@ function CallServicePanel({ context }: { context: PanelExtensionContext }): JSX.
<button
disabled={context.callService == undefined || state.serviceName === ""}
style={{ width: "100%", minHeight: "2rem" }}
onClick={async () => {
await callService(state.serviceName, state.request);
onClick={() => {
void (async () => {
await callService(state.serviceName, state.request);
})();
}}
>
{`Call ${state.serviceName}`}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ function PublishTopicPanel({ context }: { context: PanelExtensionContext }): JSX
</div>
<div>
<button
disabled={
context.advertise == undefined || context.publish == undefined || state.topicName === ""
}
disabled={context.advertise == undefined || context.publish == undefined || state.topicName === ""}
style={{ width: "100%", minHeight: "2rem" }}
onClick={() => {
publishTopic(state.topicName, state.request);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
import {
PanelExtensionContext,
RenderState,
Topic,
MessageEvent,
Immutable,
} from "@foxglove/studio";
import { PanelExtensionContext, RenderState, Topic, MessageEvent, Immutable } from "@foxglove/studio";
import { JsonViewer } from "@textea/json-viewer";
import { useLayoutEffect, useEffect, useState, useMemo } from "react";
import { createRoot } from "react-dom/client";
Expand Down Expand Up @@ -56,9 +50,7 @@ function SubscribeTopicPanel({ context }: { context: PanelExtensionContext }): J

// Save the most recent message on our topic.
if (renderState.currentFrame && renderState.currentFrame.length > 0) {
const lastFrame = renderState.currentFrame[
renderState.currentFrame.length - 1
] as MessageEvent;
const lastFrame = renderState.currentFrame[renderState.currentFrame.length - 1] as MessageEvent;

setState((oldState) => ({ ...oldState, message: lastFrame }));
}
Expand Down

0 comments on commit e85fed6

Please sign in to comment.