Skip to content

Commit

Permalink
Fix some linting problems
Browse files Browse the repository at this point in the history
  • Loading branch information
Sheeo committed Sep 11, 2024
1 parent a184818 commit 41763e1
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 25 deletions.
19 changes: 4 additions & 15 deletions settings-ui/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default observer(() => {
return <div className="fullscreenLoader"><Loading/></div>;
}

if (loadCfg.error && loadCfg.error!.message == "Failed to fetch") {
if (loadCfg.error && loadCfg.error.message == "Failed to fetch") {
// Special case: server isn't up yet.
return <div className="fullscreenLoader"><Loading/></div>;
}
Expand Down Expand Up @@ -111,25 +111,14 @@ export default observer(() => {
<div className="layout">
<div className="topRow">
<LogoCard/>
{/*<div className="portList">*/}
{/* {*/}
{/* DECKLINK_PORTS_ORDERED.map(p =>*/}
{/* <PortStatus*/}
{/* key={p}*/}
{/* port={p}*/}
{/* desc={appCtx.machineInfo.inputPorts[p]}*/}
{/* ></PortStatus>*/}
{/* )}*/}
{/*</div>*/}

<div className="statList">
<div className="statEntry">
<span>1MB/s</span>
<span>{"1MB/s"}</span>
<UplinkIcon/>
</div>

<div className="statEntry">
<span>75%</span>
<span>{"75%"}</span>
<CPU/>
</div>
</div>
Expand Down Expand Up @@ -165,6 +154,6 @@ export default observer(() => {
probeifier={prober}
/> : null}

{/*<LoadEstimator compute={0.7} localBandwidth={10000}></LoadEstimator>*/}
{ /* <LoadEstimator compute={0.7} localBandwidth={10000}></LoadEstimator> */ }
</>;
});
2 changes: 1 addition & 1 deletion settings-ui/src/AppCtx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class AppCtx {
getPortStatus(k: DecklinkPort): InputPortStatus | string {
const p = this.machineInfo.inputPorts[k]!;

if (p!.connectedMediaInfo == null) {
if (p.connectedMediaInfo == null) {
return InputPortStatus.DISCONNECTED;
}

Expand Down
2 changes: 1 addition & 1 deletion settings-ui/src/Fuzzify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export function fuzzyMatch<T extends {[k: string]: any}>(x: T, fuzz: RecursivePa
return FuzzyMatchResult.MISMATCH;
}

const b = fuzzyMatch(x[k], v);
const b = fuzzyMatch(x[k], v as RecursivePartial<object>);
if (b == FuzzyMatchResult.MISMATCH) {
return b;
}
Expand Down
4 changes: 2 additions & 2 deletions settings-ui/src/StreamBox.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import './StreamBox.sass';
import SecondaryBox from "./SecondaryBox";
import {AudioCodec, AudioVariant, Channel, FrameRate, FrameRateCfg, StreamVariantConfig} from "./api/Config";
import {AudioCodec, AudioVariant, Channel, FrameRateCfg, StreamVariantConfig} from "./api/Config";
import PortStatus from "./PortStatus";
import {useContext} from "react";
import {AppContext} from "./index";
Expand Down Expand Up @@ -63,7 +63,7 @@ function prettyPrintFramerate(t: any, f: FrameRateCfg | undefined) {
}

if (typeof f == "object") {
const fps = f as FrameRate;
const fps = f;
return (fps.numerator / fps.denominator) + "fps";
} else {
return f as string;
Expand Down
2 changes: 1 addition & 1 deletion settings-ui/src/api/Api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class Api {
async makeRequest(method: string, route: string, params: any = {}) {
if (method === "GET") {
console.log(params);
const paramsObj = new URLSearchParams(params);
const paramsObj = new URLSearchParams(params as URLSearchParams);
// Send params as GET params.
const paramStr = paramsObj.toString();
if (paramStr !== "") {
Expand Down
6 changes: 3 additions & 3 deletions settings-ui/src/hooks/useAsync.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {useCallback, useEffect, useRef, useState} from "react";
import {SetStateAction, useCallback, useEffect, useRef, useState} from "react";

export interface AsyncHookStatus {
// The current status of the async function.
Expand Down Expand Up @@ -61,10 +61,10 @@ export function useAsync<ArgsT extends any[], ResultT>(fn: (...args: ArgsT) => P
}).catch((error) => {
console.log("HERE?");
console.error(error);
setError(error);
setError(error as SetStateAction<Error | undefined>);
setStatus("rejected");
if (options.onError) {
options.onError(cArgs, error);
options.onError(cArgs, error as Error);
}
});
}, [theFunc]);
Expand Down
4 changes: 2 additions & 2 deletions settings-ui/src/modal/ChannelConfigModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ function inputIsAtLeast(appCtx: AppCtx, channel: Channel, w: number, h: number)
return false;
}

return port.connectedMediaInfo!.video.height >= h &&
port.connectedMediaInfo!.video.width >= w;
return port.connectedMediaInfo.video.height >= h &&
port.connectedMediaInfo.video.width >= w;
}

export default observer((props: ChannelConfigModalProps) => {
Expand Down

0 comments on commit 41763e1

Please sign in to comment.