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]
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -183,6 +183,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
myselector: { data: {}, table: ''},
|
||||
addNewRecord: '',
|
||||
isAppRunning: false,
|
||||
deferredPrompt: null,
|
||||
}),
|
||||
|
||||
getters: {
|
||||
|
||||
Reference in New Issue
Block a user