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]

View File

@@ -449,12 +449,12 @@ export const useUserStore = defineStore('UserStore', {
let myrec = this.getRecByCol(user, col)
if (!!myrec.name)
name = myrec.name
name = myrec.name + ' '
if (!!myrec.surname)
name += ' ' + myrec.surname
name += myrec.surname + ' '
if (!name) {
name = myrec.username
name += myrec.username + ' '
}
if (col && col.field === 'extrarec' && !name) {
name = myrec.dest
@@ -996,6 +996,8 @@ export const useUserStore = defineStore('UserStore', {
await globalStore.clearDataAfterLogout()
tools.checkApp()
return Api.SendReq('/users/me/token', 'DELETE', null)
.then((res) => {
console.log(res)

View File

@@ -183,6 +183,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
myselector: { data: {}, table: ''},
addNewRecord: '',
isAppRunning: false,
deferredPrompt: null,
}),
getters: {