fix isAppRunning

This commit is contained in:
Surya Paolo
2022-12-20 10:58:55 +01:00
parent 3aaa94c33e
commit 2a97456c0f
17 changed files with 57 additions and 36 deletions

View File

@@ -7394,6 +7394,27 @@ export const tools = {
return myarr
},
checkApp() {
const globalStore = useGlobalStore()
try {
let displayMode = 'browser';
const mqStandAlone = '(display-mode: standalone)';
// @ts-ignore
if (((navigator && (navigator.standalone))) ||
(window.matchMedia(mqStandAlone).matches)) {
console.log('navigator.standalone')
displayMode = 'standalone'
}
console.log('displayMode = ', displayMode)
globalStore.isAppRunning = displayMode === 'standalone';
} catch (e) {
console.log('error navigator.standalone ?!')
}
},
// getLocale() {
// if (navigator.languages && navigator.languages.length > 0) {
// return navigator.languages[0]