Menu bar for buttons

This commit is contained in:
David Négrier 2022-01-17 10:04:54 +01:00 committed by Alexis Faizeau
parent 06dca9813c
commit a4b4710f87
10 changed files with 146 additions and 94 deletions

View file

@ -1,6 +1,5 @@
import { derived, get, writable } from "svelte/store";
import type { CoWebsite } from "../WebRtc/CoWebsiteManager";
import { highlightedEmbedScreen } from "./EmbedScreensStore";
function createCoWebsiteStore() {
const { subscribe, set, update } = writable(Array<CoWebsite>());
@ -50,17 +49,3 @@ export const coWebsitesNotAsleep = derived([coWebsites], ([$coWebsites]) =>
export const mainCoWebsite = derived([coWebsites], ([$coWebsites]) =>
$coWebsites.find((coWebsite) => get(coWebsite.state) !== "asleep")
);
export const coWebsiteThumbails = derived(
[coWebsites, highlightedEmbedScreen, mainCoWebsite],
([$coWebsites, highlightedEmbedScreen, $mainCoWebsite]) =>
$coWebsites.filter((coWebsite, index) => {
return (
(!$mainCoWebsite || $mainCoWebsite.iframe.id !== coWebsite.iframe.id) &&
(!highlightedEmbedScreen ||
highlightedEmbedScreen.type !== "cowebsite" ||
(highlightedEmbedScreen.type === "cowebsite" &&
highlightedEmbedScreen.embed.iframe.id !== coWebsite.iframe.id))
);
})
);