This commit is contained in:
2026-08-22 22:35:10 +03:30
parent 1171390996
commit bb4bcdf600
2 changed files with 48 additions and 50 deletions
+10 -13
View File
@@ -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,
}
}