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