fix tv 3
This commit is contained in:
@@ -61,7 +61,7 @@ function isSimorghBar(product: Product) {
|
||||
|
||||
export function useTvMonitorPage() {
|
||||
const rootEl = ref<HTMLElement | null>(null)
|
||||
const { isFullscreen, enter: enterFullscreen } = useFullscreen(rootEl)
|
||||
const { isFullscreen, enter: enterFullscreen, exit: exitFullscreen } = useFullscreen(rootEl)
|
||||
|
||||
const products = ref<Product[]>([])
|
||||
const loading = ref(true)
|
||||
@@ -199,14 +199,17 @@ export function useTvMonitorPage() {
|
||||
}
|
||||
}
|
||||
|
||||
async function handleBoardClick() {
|
||||
async function toggleFullscreen(event?: Event) {
|
||||
event?.stopPropagation()
|
||||
hideCursorSoon()
|
||||
if (!isFullscreen.value) {
|
||||
try {
|
||||
try {
|
||||
if (isFullscreen.value) {
|
||||
await exitFullscreen()
|
||||
} else {
|
||||
await enterFullscreen()
|
||||
} catch {
|
||||
/* browser may require a later gesture */
|
||||
}
|
||||
} catch {
|
||||
/* browser may block without gesture */
|
||||
}
|
||||
}
|
||||
|
||||
@@ -268,12 +271,6 @@ export function useTvMonitorPage() {
|
||||
}, REFRESH_MS)
|
||||
|
||||
document.title = `${brandName.value} | تابلو قیمت`
|
||||
|
||||
try {
|
||||
await enterFullscreen()
|
||||
} catch {
|
||||
/* ignored until user clicks */
|
||||
}
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
@@ -313,6 +310,6 @@ export function useTvMonitorPage() {
|
||||
productBuyLabel,
|
||||
productSellLabel,
|
||||
liveQuoteLabel,
|
||||
handleBoardClick,
|
||||
toggleFullscreen,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user