chore: add parrainage
This commit is contained in:
@@ -16,7 +16,10 @@ import {
|
||||
getAllClients,
|
||||
getAvailableDeliveryPersons,
|
||||
getCommandCountByStatus,
|
||||
registerAdminPushToken,
|
||||
unregisterAdminPushToken,
|
||||
} from "../../api/api_admin";
|
||||
import { getExpoPushToken } from "../../utils/pushTokenUtils";
|
||||
import LoadingSpinner from "../../components/ui/LoadingSpinner";
|
||||
|
||||
interface StatCard {
|
||||
@@ -33,6 +36,14 @@ export default function DashboardScreen() {
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [refreshing, setRefreshing] = useState(false);
|
||||
|
||||
// Enregistrement push token admin au montage
|
||||
useEffect(() => {
|
||||
getExpoPushToken().then((token) => {
|
||||
if (token) registerAdminPushToken(token);
|
||||
});
|
||||
return () => { unregisterAdminPushToken(); };
|
||||
}, []);
|
||||
|
||||
const loadStats = useCallback(async () => {
|
||||
try {
|
||||
const [allCmd, pending, enRoute, completed, clients, livreurs] =
|
||||
|
||||
Reference in New Issue
Block a user