From 52442fe6d750bab725e98ba20a77c9d7fd00df98 Mon Sep 17 00:00:00 2001 From: Guillaume Chau Date: Fri, 31 May 2024 14:30:24 +0200 Subject: [PATCH] fix: refresh content on reconnect --- packages/app-frontend/src/features/App.vue | 17 ++++++++++++----- .../src/features/connection/index.ts | 5 +++++ 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/packages/app-frontend/src/features/App.vue b/packages/app-frontend/src/features/App.vue index 3bc608134..aa4f10c25 100644 --- a/packages/app-frontend/src/features/App.vue +++ b/packages/app-frontend/src/features/App.vue @@ -37,7 +37,7 @@ export default defineComponent({ }, setup() { - const { isConnected, isInitializing, showDisplayDisconnected } = useAppConnection() + const { isConnected, isInitializing, showDisplayDisconnected, connectedTimes } = useAppConnection() function updateTheme(theme: string) { if (theme === 'dark' || theme === 'high-contrast' || (theme === 'auto' && chromeTheme === 'dark')) { @@ -81,6 +81,7 @@ export default defineComponent({ isConnected, isInitializing, showDisplayDisconnected, + connectedTimes, showAppsSelector, orientation, isChrome, @@ -91,10 +92,9 @@ export default defineComponent({ + diff --git a/packages/app-frontend/src/features/connection/index.ts b/packages/app-frontend/src/features/connection/index.ts index 7bd94c50a..73d141c84 100644 --- a/packages/app-frontend/src/features/connection/index.ts +++ b/packages/app-frontend/src/features/connection/index.ts @@ -4,6 +4,7 @@ import { useNow } from '@vueuse/core' const isConnected = ref(false) const isInitializing = ref(true) const lastDisconnect = ref(0) +const connectedTimes = ref(0) export function useAppConnection() { const now = useNow({ @@ -25,6 +26,7 @@ export function useAppConnection() { isInitializing, lastDisconnect, showDisplayDisconnected, + connectedTimes, } } @@ -36,6 +38,9 @@ export function setAppConnected(value: boolean, force = false) { lastDisconnect.value = Date.now() } isConnected.value = value + if (value) { + connectedTimes.value++ + } } export function setAppInitializing(value: boolean) {