mirror of https://github.com/jetkvm/kvm.git
fix(ui): specify JsonRpcResponse type
This commit is contained in:
parent
a6f2f075ff
commit
3295b3a96a
|
@ -65,12 +65,12 @@ export default function SettingsVideoRoute() {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setEdidLoading(true);
|
setEdidLoading(true);
|
||||||
send("getStreamQualityFactor", {}, resp => {
|
send("getStreamQualityFactor", {}, (resp: JsonRpcResponse) => {
|
||||||
if ("error" in resp) return;
|
if ("error" in resp) return;
|
||||||
setStreamQuality(String(resp.result));
|
setStreamQuality(String(resp.result));
|
||||||
});
|
});
|
||||||
|
|
||||||
send("getEDID", {}, resp => {
|
send("getEDID", {}, (resp: JsonRpcResponse) => {
|
||||||
setEdidLoading(false);
|
setEdidLoading(false);
|
||||||
if ("error" in resp) {
|
if ("error" in resp) {
|
||||||
notifications.error(`Failed to get EDID: ${resp.error.data || "Unknown error"}`);
|
notifications.error(`Failed to get EDID: ${resp.error.data || "Unknown error"}`);
|
||||||
|
@ -117,7 +117,7 @@ export default function SettingsVideoRoute() {
|
||||||
|
|
||||||
const handleEDIDChange = (newEdid: string) => {
|
const handleEDIDChange = (newEdid: string) => {
|
||||||
setEdidLoading(true);
|
setEdidLoading(true);
|
||||||
send("setEDID", { edid: newEdid }, resp => {
|
send("setEDID", { edid: newEdid }, (resp: JsonRpcResponse) => {
|
||||||
setEdidLoading(false);
|
setEdidLoading(false);
|
||||||
if ("error" in resp) {
|
if ("error" in resp) {
|
||||||
notifications.error(`Failed to set EDID: ${resp.error.data || "Unknown error"}`);
|
notifications.error(`Failed to set EDID: ${resp.error.data || "Unknown error"}`);
|
||||||
|
|
Loading…
Reference in New Issue