feat(db): mesh data model — meshes, members, invites, audit log
- pgSchema "mesh" with 4 tables isolating the peer mesh domain - Enums: visibility, transport, tier, role - audit_log is metadata-only (E2E encryption enforced at broker/client) - Cascade on mesh delete, soft-delete via archivedAt/revokedAt Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
1
packages/analytics/mobile/src/hooks/index.ts
Normal file
1
packages/analytics/mobile/src/hooks/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from "./use-tracking-permissions";
|
||||
@@ -0,0 +1,32 @@
|
||||
import { requestTrackingPermissionsAsync } from "expo-tracking-transparency";
|
||||
import { useEffect, useState, useCallback } from "react";
|
||||
import { AppState } from "react-native";
|
||||
|
||||
export const useTrackingPermissions = () => {
|
||||
const [granted, setGranted] = useState(false);
|
||||
|
||||
const checkPermission = useCallback(async () => {
|
||||
const { granted: isGranted } = await requestTrackingPermissionsAsync();
|
||||
setGranted(isGranted);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
void checkPermission();
|
||||
}, [checkPermission]);
|
||||
|
||||
useEffect(() => {
|
||||
const subscription = AppState.addEventListener("change", (status) => {
|
||||
if (status !== "active") {
|
||||
return;
|
||||
}
|
||||
|
||||
void checkPermission();
|
||||
});
|
||||
|
||||
return () => {
|
||||
subscription.remove();
|
||||
};
|
||||
}, [checkPermission]);
|
||||
|
||||
return granted;
|
||||
};
|
||||
Reference in New Issue
Block a user