mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-10 17:49:58 +00:00
Fix unused locals and better receiver selector available media checking
This commit is contained in:
@@ -4,55 +4,12 @@
|
||||
import React, { Component } from "react";
|
||||
import semver from "semver";
|
||||
|
||||
import { getNextEllipsis
|
||||
, getWindowCenteredProps } from "../../lib/utils";
|
||||
|
||||
import { BridgeInfo } from "../../lib/bridge";
|
||||
import { getNextEllipsis } from "../../lib/utils";
|
||||
|
||||
|
||||
const _ = browser.i18n.getMessage;
|
||||
|
||||
const ENDPOINT_URL = "https://api.github.com/repos/hensm/fx_cast/releases/latest";
|
||||
|
||||
|
||||
async function downloadApp (info: any, platform: string) {
|
||||
const download = browser.downloads.download({
|
||||
filename: info[platform].name
|
||||
, url: info[platform].url
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
interface BridgeDownloadsProps {
|
||||
info: any;
|
||||
}
|
||||
|
||||
const BridgeDownloads = (props: BridgeDownloadsProps) => (
|
||||
<div className="bridge-downloads">
|
||||
<button className="bridge-downloads__download
|
||||
bridge-downloads__win"
|
||||
disabled
|
||||
onClick={ () => downloadApp(props.info, "win") }>
|
||||
Windows
|
||||
</button>
|
||||
<button className="bridge-downloads__download
|
||||
bridge-downloads__mac"
|
||||
onClick={ () => downloadApp(props.info, "mac") }>
|
||||
macOS
|
||||
</button>
|
||||
|
||||
<div className="bridge-downloads__linux">
|
||||
<button className="bridge-downloads__download"
|
||||
onClick={ () => downloadApp(props.info, "deb") }>
|
||||
Linux (deb)
|
||||
</button>
|
||||
<button className="bridge-downloads__download"
|
||||
onClick={ () => downloadApp(props.info, "rpm") }>
|
||||
Linux (rpm)
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
|
||||
interface BridgeStatsProps {
|
||||
info: BridgeInfo;
|
||||
@@ -236,7 +193,7 @@ export default class Bridge extends Component<BridgeProps, BridgeState> {
|
||||
}));
|
||||
}, 500);
|
||||
|
||||
fetch(ENDPOINT_URL)
|
||||
fetch("https://api.github.com/repos/hensm/fx_cast/releases/latest")
|
||||
.then(res => {
|
||||
window.clearTimeout(timeout);
|
||||
return res.json();
|
||||
|
||||
@@ -400,19 +400,6 @@ class OptionsApp extends Component<{}, OptionsAppState> {
|
||||
private getWhitelistItemPatternError (info: string): string {
|
||||
return _("optionsUserAgentWhitelistInvalidMatchPattern", info);
|
||||
}
|
||||
|
||||
private async updateBridgeInfo () {
|
||||
this.setState({
|
||||
bridgeLoading: true
|
||||
});
|
||||
|
||||
const bridgeInfo = await bridge.getInfo();
|
||||
|
||||
this.setState({
|
||||
bridgeInfo
|
||||
, bridgeLoading: false
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user