mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-14 20:39:03 +00:00
Fix video autoclose (#6843)
Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
parent
4f213c48d4
commit
1107328443
@ -102,7 +102,7 @@
|
|||||||
<div class="antiHSpacer" />
|
<div class="antiHSpacer" />
|
||||||
{:else if secondaryNotifyMarker}
|
{:else if secondaryNotifyMarker}
|
||||||
<div class="antiHSpacer" />
|
<div class="antiHSpacer" />
|
||||||
<NotifyMarker count={0} kind="simple" />
|
<NotifyMarker count={0} kind="with-dot" />
|
||||||
<div class="antiHSpacer" />
|
<div class="antiHSpacer" />
|
||||||
{/if}
|
{/if}
|
||||||
</svelte:fragment>
|
</svelte:fragment>
|
||||||
|
@ -301,7 +301,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function checkActiveVideo (loc: Location, video: boolean, room: Ref<Room> | undefined): void {
|
function checkActiveVideo (loc: Location, video: boolean, room: Ref<Room> | undefined): void {
|
||||||
const isOpened = $sidebarStore.widgetsState.has(love.ids.VideoWidget)
|
const widgetState = $sidebarStore.widgetsState.get(love.ids.VideoWidget)
|
||||||
|
const isOpened = widgetState !== undefined
|
||||||
|
|
||||||
if (room === undefined) {
|
if (room === undefined) {
|
||||||
if (isOpened) {
|
if (isOpened) {
|
||||||
@ -319,11 +320,15 @@
|
|||||||
{
|
{
|
||||||
room
|
room
|
||||||
},
|
},
|
||||||
loc.path[2] !== loveId
|
{ active: loc.path[2] !== loveId, openedByUser: false }
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (loc.path[2] === loveId && $sidebarStore.widget === love.ids.VideoWidget) {
|
if (
|
||||||
|
loc.path[2] === loveId &&
|
||||||
|
$sidebarStore.widget === love.ids.VideoWidget &&
|
||||||
|
widgetState?.openedByUser !== true
|
||||||
|
) {
|
||||||
minimizeSidebar()
|
minimizeSidebar()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
export let count: number = 0
|
export let count: number = 0
|
||||||
export let kind: 'primary' | 'simple' = 'primary'
|
export let kind: 'primary' | 'simple' | 'with-dot' = 'primary'
|
||||||
export let size: 'xx-small' | 'x-small' | 'small' | 'medium' = 'small'
|
export let size: 'xx-small' | 'x-small' | 'small' | 'medium' = 'small'
|
||||||
|
|
||||||
const maxNumber = 9
|
const maxNumber = 9
|
||||||
@ -34,6 +34,10 @@
|
|||||||
<div class="notifyMarker {size} {kind}" />
|
<div class="notifyMarker {size} {kind}" />
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
{#if kind === 'with-dot'}
|
||||||
|
<div class="notifyMarker {size} {kind}">●</div>
|
||||||
|
{/if}
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.notifyMarker {
|
.notifyMarker {
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -44,6 +48,7 @@
|
|||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
|
|
||||||
&.simple,
|
&.simple,
|
||||||
|
&.with-dot,
|
||||||
&.primary {
|
&.primary {
|
||||||
background-color: var(--global-higlight-Color);
|
background-color: var(--global-higlight-Color);
|
||||||
color: var(--global-on-accent-TextColor);
|
color: var(--global-on-accent-TextColor);
|
||||||
@ -70,5 +75,10 @@
|
|||||||
height: 1.25rem;
|
height: 1.25rem;
|
||||||
font-size: 0.625rem;
|
font-size: 0.625rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.with-dot {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 0.25rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
if (selected === widget._id) {
|
if (selected === widget._id) {
|
||||||
minimizeSidebar(true)
|
minimizeSidebar(true)
|
||||||
} else {
|
} else {
|
||||||
openWidget(widget, $sidebarStore.widgetsState.get(widget._id)?.data, true)
|
openWidget(widget, $sidebarStore.widgetsState.get(widget._id)?.data, { active: true, openedByUser: true })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,6 +32,7 @@ export interface WidgetState {
|
|||||||
tabs: WidgetTab[]
|
tabs: WidgetTab[]
|
||||||
tab?: string
|
tab?: string
|
||||||
closedByUser?: boolean
|
closedByUser?: boolean
|
||||||
|
openedByUser?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SidebarState {
|
export interface SidebarState {
|
||||||
@ -97,16 +98,23 @@ function setSidebarStateToLocalStorage (state: SidebarState): void {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function openWidget (widget: Widget, data?: Record<string, any>, active = true): void {
|
export function openWidget (
|
||||||
|
widget: Widget,
|
||||||
|
data?: Record<string, any>,
|
||||||
|
params?: { active: boolean, openedByUser: boolean }
|
||||||
|
): void {
|
||||||
const state = get(sidebarStore)
|
const state = get(sidebarStore)
|
||||||
const { widgetsState } = state
|
const { widgetsState } = state
|
||||||
const widgetState = widgetsState.get(widget._id)
|
const widgetState = widgetsState.get(widget._id)
|
||||||
|
const active = params?.active ?? true
|
||||||
|
const openedByUser = params?.openedByUser ?? false
|
||||||
|
|
||||||
widgetsState.set(widget._id, {
|
widgetsState.set(widget._id, {
|
||||||
_id: widget._id,
|
_id: widget._id,
|
||||||
data: data ?? widgetState?.data,
|
data: data ?? widgetState?.data,
|
||||||
tab: widgetState?.tab,
|
tab: widgetState?.tab,
|
||||||
tabs: widgetState?.tabs ?? []
|
tabs: widgetState?.tabs ?? [],
|
||||||
|
openedByUser
|
||||||
})
|
})
|
||||||
|
|
||||||
Analytics.handleEvent('workbench.OpenSidebarWidget', { widget: widget._id })
|
Analytics.handleEvent('workbench.OpenSidebarWidget', { widget: widget._id })
|
||||||
|
Loading…
Reference in New Issue
Block a user