fix:privacy
This commit is contained in:
parent
9793df1c57
commit
8b26530d52
6 changed files with 120 additions and 12 deletions
51
src/composables/usePermissions.ts
Normal file
51
src/composables/usePermissions.ts
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
import { useQuasar } from 'quasar'
|
||||
import { usePrivacyStore } from '@/stores/privacy'
|
||||
|
||||
export function usePermissions() {
|
||||
const $q = useQuasar()
|
||||
const privacyStore = usePrivacyStore()
|
||||
|
||||
const checkCameraPermission = (): boolean => {
|
||||
if (!privacyStore.isAccepted) {
|
||||
privacyStore.modalPrivacy = true
|
||||
$q.notify({
|
||||
type: 'warning',
|
||||
message: 'กรุณายอมรับนโยบายคุ้มครองข้อมูลส่วนบุคคลก่อนใช้งานกล้อง',
|
||||
position: 'top',
|
||||
})
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
const checkLocationPermission = (): boolean => {
|
||||
if (!privacyStore.isAccepted) {
|
||||
privacyStore.modalPrivacy = true
|
||||
$q.notify({
|
||||
type: 'warning',
|
||||
message: 'กรุณายอมรับนโยบายคุ้มครองข้อมูลส่วนบุคคลก่อนใช้งานแผนที่',
|
||||
position: 'top',
|
||||
})
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
const checkPrivacyAccepted = (): boolean => {
|
||||
if (!privacyStore.isAccepted) {
|
||||
$q.notify({
|
||||
type: 'warning',
|
||||
message: 'กรุณายอมรับนโยบายคุ้มครองข้อมูลส่วนบุคคลก่อนใช้งาน',
|
||||
position: 'top',
|
||||
})
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
return {
|
||||
checkCameraPermission,
|
||||
checkLocationPermission,
|
||||
checkPrivacyAccepted,
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue