Skip to content

Commit

Permalink
More type fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderson1993 committed May 27, 2024
1 parent 4515fef commit f834108
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/components/views/DamageControl/wingPower.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const WingPower: React.FC<{
wingedSystems,
}) => {
const [setWingPower] = useReactorSetWingPowerMutation();
const reactorPower = reactor[`${wing}WingPower`];
return (
<React.Fragment>
<tr>
Expand All @@ -53,7 +54,10 @@ const WingPower: React.FC<{
<td>{capitalCase(wing)} Wing Power</td>
<td>
<OutputField
alert={wingedSystems[`${wing}Power`] > reactor[`${wing}WingPower`]}
alert={
typeof reactorPower === "number" &&
wingedSystems[`${wing}Power`] > reactorPower
}
>
{wingedSystems[`${wing}Power`]}
</OutputField>
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/hooks/usePatchedSubscriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function usePatchedSubscriptions<SubData, VariableDefinition>(
.request({
query,
operationName,
variables,
variables: variables as any,
})
.subscribe({
next: ({data}) => {
Expand Down
10 changes: 10 additions & 0 deletions src/helpers/tourHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ const SET_CLIENT_TRAINING = gql`
}
`;

/**
* Helper component for displaying a tour with steps.
*
* @param {Object} props - The component props.
* @param {Array} props.steps - An array of steps for the tour.
* @param {string} [props.innerKey] - The inner key for the tour component.
* @param {boolean} [props.training] - Flag indicating if the tour is in training mode.
* @param {function} [props.onRequestClose] - Callback function to be called when the tour is closed.
* @returns {JSX.Element|null} The rendered Tour component or null if there are no steps.
*/
const TourHelper = ({
steps,
innerKey = undefined,
Expand Down

0 comments on commit f834108

Please sign in to comment.