fix isAppRunning
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user