Skip to content

Commit 41763e1

Browse files
committed
Fix some linting problems
1 parent a184818 commit 41763e1

File tree

7 files changed

+14
-25
lines changed

7 files changed

+14
-25
lines changed

settings-ui/src/App.tsx

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default observer(() => {
4242
return <div className="fullscreenLoader"><Loading/></div>;
4343
}
4444

45-
if (loadCfg.error && loadCfg.error!.message == "Failed to fetch") {
45+
if (loadCfg.error && loadCfg.error.message == "Failed to fetch") {
4646
// Special case: server isn't up yet.
4747
return <div className="fullscreenLoader"><Loading/></div>;
4848
}
@@ -111,25 +111,14 @@ export default observer(() => {
111111
<div className="layout">
112112
<div className="topRow">
113113
<LogoCard/>
114-
{/*<div className="portList">*/}
115-
{/* {*/}
116-
{/* DECKLINK_PORTS_ORDERED.map(p =>*/}
117-
{/* <PortStatus*/}
118-
{/* key={p}*/}
119-
{/* port={p}*/}
120-
{/* desc={appCtx.machineInfo.inputPorts[p]}*/}
121-
{/* ></PortStatus>*/}
122-
{/* )}*/}
123-
{/*</div>*/}
124-
125114
<div className="statList">
126115
<div className="statEntry">
127-
<span>1MB/s</span>
116+
<span>{"1MB/s"}</span>
128117
<UplinkIcon/>
129118
</div>
130119

131120
<div className="statEntry">
132-
<span>75%</span>
121+
<span>{"75%"}</span>
133122
<CPU/>
134123
</div>
135124
</div>
@@ -165,6 +154,6 @@ export default observer(() => {
165154
probeifier={prober}
166155
/> : null}
167156

168-
{/*<LoadEstimator compute={0.7} localBandwidth={10000}></LoadEstimator>*/}
157+
{ /* <LoadEstimator compute={0.7} localBandwidth={10000}></LoadEstimator> */ }
169158
</>;
170159
});

settings-ui/src/AppCtx.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export class AppCtx {
5151
getPortStatus(k: DecklinkPort): InputPortStatus | string {
5252
const p = this.machineInfo.inputPorts[k]!;
5353

54-
if (p!.connectedMediaInfo == null) {
54+
if (p.connectedMediaInfo == null) {
5555
return InputPortStatus.DISCONNECTED;
5656
}
5757

settings-ui/src/Fuzzify.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export function fuzzyMatch<T extends {[k: string]: any}>(x: T, fuzz: RecursivePa
3737
return FuzzyMatchResult.MISMATCH;
3838
}
3939

40-
const b = fuzzyMatch(x[k], v);
40+
const b = fuzzyMatch(x[k], v as RecursivePartial<object>);
4141
if (b == FuzzyMatchResult.MISMATCH) {
4242
return b;
4343
}

settings-ui/src/StreamBox.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import './StreamBox.sass';
22
import SecondaryBox from "./SecondaryBox";
3-
import {AudioCodec, AudioVariant, Channel, FrameRate, FrameRateCfg, StreamVariantConfig} from "./api/Config";
3+
import {AudioCodec, AudioVariant, Channel, FrameRateCfg, StreamVariantConfig} from "./api/Config";
44
import PortStatus from "./PortStatus";
55
import {useContext} from "react";
66
import {AppContext} from "./index";
@@ -63,7 +63,7 @@ function prettyPrintFramerate(t: any, f: FrameRateCfg | undefined) {
6363
}
6464

6565
if (typeof f == "object") {
66-
const fps = f as FrameRate;
66+
const fps = f;
6767
return (fps.numerator / fps.denominator) + "fps";
6868
} else {
6969
return f as string;

settings-ui/src/api/Api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export class Api {
2020
async makeRequest(method: string, route: string, params: any = {}) {
2121
if (method === "GET") {
2222
console.log(params);
23-
const paramsObj = new URLSearchParams(params);
23+
const paramsObj = new URLSearchParams(params as URLSearchParams);
2424
// Send params as GET params.
2525
const paramStr = paramsObj.toString();
2626
if (paramStr !== "") {

settings-ui/src/hooks/useAsync.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {useCallback, useEffect, useRef, useState} from "react";
1+
import {SetStateAction, useCallback, useEffect, useRef, useState} from "react";
22

33
export interface AsyncHookStatus {
44
// The current status of the async function.
@@ -61,10 +61,10 @@ export function useAsync<ArgsT extends any[], ResultT>(fn: (...args: ArgsT) => P
6161
}).catch((error) => {
6262
console.log("HERE?");
6363
console.error(error);
64-
setError(error);
64+
setError(error as SetStateAction<Error | undefined>);
6565
setStatus("rejected");
6666
if (options.onError) {
67-
options.onError(cArgs, error);
67+
options.onError(cArgs, error as Error);
6868
}
6969
});
7070
}, [theFunc]);

settings-ui/src/modal/ChannelConfigModal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ function inputIsAtLeast(appCtx: AppCtx, channel: Channel, w: number, h: number)
6767
return false;
6868
}
6969

70-
return port.connectedMediaInfo!.video.height >= h &&
71-
port.connectedMediaInfo!.video.width >= w;
70+
return port.connectedMediaInfo.video.height >= h &&
71+
port.connectedMediaInfo.video.width >= w;
7272
}
7373

7474
export default observer((props: ChannelConfigModalProps) => {

0 commit comments

Comments
 (0)