hrms-checkin/src/composables/usePermissions.ts

53 lines
1.6 KiB
TypeScript
Raw Normal View History

2026-01-19 14:47:32 +07:00
import { useQuasar } from 'quasar'
import { usePrivacyStore } from '@/stores/privacy'
export function usePermissions() {
const $q = useQuasar()
const privacyStore = usePrivacyStore()
2026-01-19 15:01:13 +07:00
// const checkCameraPermission = (): boolean => {
// if (!privacyStore.isAccepted) {
// privacyStore.modalPrivacy = true
// $q.notify({
// type: 'warning',
// message: 'กรุณายอมรับนโยบายคุ้มครองข้อมูลส่วนบุคคลก่อนใช้งานกล้อง',
// position: 'top',
// })
// return false
// }
// return true
// }
2026-01-19 14:47:32 +07:00
2026-01-19 15:01:13 +07:00
// const checkLocationPermission = (): boolean => {
// if (!privacyStore.isAccepted) {
// privacyStore.modalPrivacy = true
// $q.notify({
// type: 'warning',
// message: 'กรุณายอมรับนโยบายคุ้มครองข้อมูลส่วนบุคคลก่อนใช้งานแผนที่',
// position: 'top',
// })
// return false
// }
// return true
// }
2026-01-19 14:47:32 +07:00
const checkPrivacyAccepted = (): boolean => {
if (!privacyStore.isAccepted) {
2026-01-19 15:01:13 +07:00
privacyStore.modalPrivacy = true
2026-01-19 14:47:32 +07:00
$q.notify({
type: 'warning',
message: 'กรุณายอมรับนโยบายคุ้มครองข้อมูลส่วนบุคคลก่อนใช้งาน',
position: 'top',
})
return false
}
return true
}
return {
2026-01-19 15:01:13 +07:00
// checkCameraPermission,
// checkLocationPermission,
2026-01-19 14:47:32 +07:00
checkPrivacyAccepted,
}
}