Remove popup deviceStore

This commit is contained in:
hensm
2022-08-27 04:18:29 +01:00
parent 7296507498
commit 5b17e166e7
4 changed files with 12 additions and 19 deletions

View File

@@ -16,7 +16,6 @@
import { hasRequiredCapabilities } from "../../cast/utils";
import Receiver from "./Receiver.svelte";
import deviceStore from "./deviceStore";
const _ = browser.i18n.getMessage;
@@ -25,6 +24,9 @@
/** Media types available to select. */
let availableMediaTypes = ReceiverSelectorMediaType.App;
/** Devices to display. */
let devices: ReceiverDevice[] = [];
/** Sender app ID (if available). */
let appId: Optional<string>;
/** Page info (if launched from page context). */
@@ -166,7 +168,7 @@
updateKnownApp();
$deviceStore = message.data.receiverDevices;
devices = message.data.receiverDevices;
break;
}
@@ -267,7 +269,7 @@
// Match by index rendered receiver element to device array
if (receiverElementIndex > -1) {
return $deviceStore[receiverElementIndex];
return devices[receiverElementIndex];
}
}
@@ -418,12 +420,12 @@
{/if}
<ul class="receiver-list">
{#if !$deviceStore.length}
{#if !devices.length}
<div class="receiver-list__not-found">
{_("popupNoReceiversFound")}
</div>
{:else}
{#each $deviceStore as device}
{#each devices as device}
<Receiver
{port}
{device}