mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-08 16:49:58 +00:00
Rename requestedAppId -> appId and fix receiver selector app names
This commit is contained in:
@@ -22,7 +22,7 @@ export interface Shim {
|
||||
contentPort: AnyPort;
|
||||
contentTabId?: number;
|
||||
contentFrameId?: number;
|
||||
requestedAppId?: string;
|
||||
appId?: string;
|
||||
}
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ export default new class ShimManager {
|
||||
|
||||
switch (message.subject) {
|
||||
case "main:shimReady": {
|
||||
shim.requestedAppId = message.data.appId;
|
||||
shim.appId = message.data.appId;
|
||||
|
||||
for (const receiver of StatusManager.getReceivers()) {
|
||||
shim.contentPort.postMessage({
|
||||
|
||||
@@ -37,7 +37,7 @@ export default class NativeReceiverSelector extends ReceiverSelector {
|
||||
receivers: Receiver[]
|
||||
, defaultMediaType: ReceiverSelectorMediaType
|
||||
, availableMediaTypes: ReceiverSelectorMediaType
|
||||
, requestedAppId?: string): Promise<void> {
|
||||
, appId?: string): Promise<void> {
|
||||
|
||||
this.bridgePort = await bridge.connect();
|
||||
|
||||
@@ -72,7 +72,7 @@ export default class NativeReceiverSelector extends ReceiverSelector {
|
||||
, i18n_castButtonTitle: _("popupCastButtonTitle")
|
||||
, i18n_stopButtonTitle: _("popupStopButtonTitle")
|
||||
, i18n_mediaTypeApp:
|
||||
(requestedAppId && knownApps[requestedAppId]?.name)
|
||||
(appId && knownApps[appId]?.name)
|
||||
?? _("popupMediaTypeApp")
|
||||
, i18n_mediaTypeTab: _("popupMediaTypeTab")
|
||||
, i18n_mediaTypeScreen: _("popupMediaTypeScreen")
|
||||
|
||||
@@ -46,7 +46,7 @@ export default abstract class ReceiverSelector
|
||||
receivers: Receiver[]
|
||||
, defaultMediaType: ReceiverSelectorMediaType
|
||||
, availableMediaTypes: ReceiverSelectorMediaType
|
||||
, requestedAppId?: string): void;
|
||||
, appId?: string): void;
|
||||
|
||||
abstract update (receivers: Receiver[]): void;
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ async function getSelection (
|
||||
* If the current context is running the mirroring app, pretend
|
||||
* it doesn't exist because it shouldn't be launched like this.
|
||||
*/
|
||||
if (currentShim?.requestedAppId ===
|
||||
if (currentShim?.appId ===
|
||||
await options.get("mirroringAppId")) {
|
||||
currentShim = undefined;
|
||||
}
|
||||
@@ -211,7 +211,7 @@ async function getSelection (
|
||||
Array.from(StatusManager.getReceivers())
|
||||
, defaultMediaType
|
||||
, availableMediaTypes
|
||||
, currentShim?.requestedAppId);
|
||||
, currentShim?.appId);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ interface PopupAppState {
|
||||
isLoading: boolean;
|
||||
|
||||
filePath?: string;
|
||||
requestedAppId?: string;
|
||||
appId?: string;
|
||||
|
||||
mirroringEnabled: boolean;
|
||||
}
|
||||
@@ -74,7 +74,7 @@ class PopupApp extends Component<{}, PopupAppState> {
|
||||
switch (message.subject) {
|
||||
case "popup:init": {
|
||||
this.setState({
|
||||
requestedAppId: message.data?.appId
|
||||
appId: message.data?.appId
|
||||
});
|
||||
|
||||
break;
|
||||
@@ -164,10 +164,10 @@ class PopupApp extends Component<{}, PopupAppState> {
|
||||
<option value={ ReceiverSelectorMediaType.App }
|
||||
selected={ isAppMediaTypeSelected }
|
||||
disabled={ !isAppMediaTypeAvailable }>
|
||||
{ (this.state.requestedAppId && knownApps[this.state.requestedAppId]?.name)
|
||||
?? isAppMediaTypeAvailable
|
||||
{ (this.state.appId && knownApps[this.state.appId]?.name)
|
||||
?? (isAppMediaTypeAvailable
|
||||
? _("popupMediaTypeApp")
|
||||
: _("popupMediaTypeAppNotFound") }
|
||||
: _("popupMediaTypeAppNotFound")) }
|
||||
</option>
|
||||
|
||||
{ this.state.mirroringEnabled &&
|
||||
|
||||
Reference in New Issue
Block a user