UBERF-10759 Allow to share screen from media panel (#8926)
Some checks are pending
CI / build (push) Waiting to run
CI / svelte-check (push) Blocked by required conditions
CI / formatting (push) Blocked by required conditions
CI / test (push) Blocked by required conditions
CI / uitest (push) Waiting to run
CI / uitest-pg (push) Waiting to run
CI / uitest-qms (push) Waiting to run
CI / uitest-workspaces (push) Waiting to run
CI / docker-build (push) Blocked by required conditions
CI / dist-build (push) Blocked by required conditions

Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
Alexander Onnikov 2025-05-14 16:34:00 +07:00 committed by GitHub
parent 467267a67a
commit 2ba46c2d34
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -16,18 +16,29 @@
import { tooltip, eventToHTMLElement, showPopup } from '@hcengineering/ui'
import love from '../plugin'
import { isSharingEnabled } from '../utils'
import { isConnected, isSharingEnabled, isShareWithSound, screenSharing, setShare } from '../utils'
import SharingStatePopup from './SharingStatePopup.svelte'
import IconShare from './icons/Share.svelte'
let disabled: boolean = false
let pressed: boolean = false
function handleClick (ev: MouseEvent): void {
function handleShowPopup (ev: MouseEvent): void {
pressed = true
showPopup(SharingStatePopup, {}, eventToHTMLElement(ev), () => {
pressed = false
})
}
function handleShare (): void {
if (disabled) return
const audio = $isShareWithSound
void setShare(true, audio)
}
$: disabled = !$screenSharing && !$isConnected
</script>
{#if $isSharingEnabled}
@ -35,7 +46,17 @@
class="hulyStatusBarButton mini positive positiveContent"
class:pressed
use:tooltip={{ label: love.string.Sharing, direction: 'bottom' }}
on:click={handleClick}
on:click={handleShowPopup}
>
<IconShare size={'small'} />
</button>
{:else}
<button
class="hulyStatusBarButton mini disabled"
class:pressed
{disabled}
use:tooltip={{ label: love.string.Share, direction: 'bottom' }}
on:click={handleShare}
>
<IconShare size={'small'} />
</button>