Fix unused locals and better receiver selector available media checking

This commit is contained in:
hensm
2019-08-16 12:57:23 +01:00
parent 1c67354e1d
commit e2eca07876
28 changed files with 282 additions and 363 deletions

View File

@@ -4,9 +4,9 @@ import bridge from "../lib/bridge";
import loadSender from "../lib/loadSender";
import options from "../lib/options";
import { TypedEventTarget } from "../lib/typedEvents";
import { Message } from "../types";
import { getMediaTypesForPageUrl } from "../lib/utils";
import { ReceiverSelectorMediaType } from "./receiverSelector";
import ReceiverSelectorManager
@@ -140,17 +140,15 @@ export default new class ShimManager {
}
case "main:/selectReceiverBegin": {
const allMediaTypes =
ReceiverSelectorMediaType.App
| ReceiverSelectorMediaType.Tab
| ReceiverSelectorMediaType.Screen
| ReceiverSelectorMediaType.File;
const contentTab = await browser.tabs.get(shim.contentTabId);
const availableMediaTypes = getMediaTypesForPageUrl(
contentTab.url);
try {
const selection = await ReceiverSelectorManager
.getSelection(
ReceiverSelectorMediaType.App
, allMediaTypes);
, availableMediaTypes);
// Handle cancellation
if (!selection) {