mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-10 09:39:58 +00:00
Fix unused locals and better receiver selector available media checking
This commit is contained in:
@@ -83,6 +83,29 @@ async function getSelection (
|
||||
});
|
||||
|
||||
|
||||
const opts = await options.getAll();
|
||||
|
||||
// Remove mirroring media types if mirroring is not enabled.
|
||||
if (!opts.mirroringEnabled) {
|
||||
availableMediaTypes &= ~(
|
||||
ReceiverSelectorMediaType.Tab
|
||||
| ReceiverSelectorMediaType.Screen);
|
||||
}
|
||||
|
||||
// Remove file media type if local media is not enabled
|
||||
if (!opts.mediaEnabled || !opts.localMediaEnabled) {
|
||||
availableMediaTypes &= ~ReceiverSelectorMediaType.File;
|
||||
}
|
||||
|
||||
if (!availableMediaTypes || availableMediaTypes
|
||||
=== ReceiverSelectorMediaType.File) {
|
||||
console.error("fx_cast (Debug): No available media types");
|
||||
resolve(null);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Ensure status manager is initialized
|
||||
await StatusManager.init();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user