chore: update
This commit is contained in:
@@ -352,6 +352,7 @@ export default function ProductsScreen() {
|
||||
// 3) Upload new media pour les produits existants (mode edit)
|
||||
if (editingProduct && pendingMedia.length > 0) {
|
||||
setUploadingMedia(true);
|
||||
const uploadErrors: string[] = [];
|
||||
for (const m of pendingMedia) {
|
||||
try {
|
||||
await uploadProductMediaAdmin(
|
||||
@@ -361,11 +362,17 @@ export default function ProductsScreen() {
|
||||
m.mimeType,
|
||||
m.mediaType,
|
||||
);
|
||||
} catch {
|
||||
/* ignore individual failures */
|
||||
} catch (uploadErr: any) {
|
||||
const msg = uploadErr?.response?.data?.error || uploadErr?.message || `Erreur upload ${m.mediaType}`;
|
||||
uploadErrors.push(msg);
|
||||
}
|
||||
}
|
||||
setUploadingMedia(false);
|
||||
if (uploadErrors.length > 0) {
|
||||
setFormError(`Erreur upload média: ${uploadErrors.join(", ")}`);
|
||||
await loadData();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
showSuccess(
|
||||
|
||||
@@ -792,15 +792,9 @@ export default function UsersScreen() {
|
||||
<Text style={styles.statLabel}>Cmd</Text>
|
||||
</View>
|
||||
{pointsEnabled && poolNames.map((name, i) => {
|
||||
let value: number;
|
||||
let color: string;
|
||||
if (i === 0) { value = item.clientData!.point; color = colors.success; }
|
||||
else if (i === 1) { value = item.clientData!.points_zipette; color = colors.info; }
|
||||
else {
|
||||
const key = poolKeys[i] ?? "";
|
||||
value = item.clientData!.points_extra?.[key] ?? 0;
|
||||
color = colors.warning;
|
||||
}
|
||||
const key = poolKeys[i] ?? "";
|
||||
const value = key ? (item.clientData!.points_extra?.[key] ?? 0) : 0;
|
||||
const color = i === 0 ? colors.success : i === 1 ? colors.info : colors.warning;
|
||||
return (
|
||||
<View key={i} style={styles.stat}>
|
||||
<Text style={[styles.statValue, { color }]}>{value}</Text>
|
||||
|
||||
@@ -137,15 +137,9 @@ export default function UsersScreen() {
|
||||
</Text>
|
||||
<View style={styles.statsRow}>
|
||||
{appSettings.points_enabled && appSettings.pool_names.map((name, i) => {
|
||||
let value: number;
|
||||
let color: string;
|
||||
if (i === 0) { value = item.point; color = colors.success; }
|
||||
else if (i === 1) { value = item.points_zipette; color = colors.info; }
|
||||
else {
|
||||
const key = appSettings.pool_keys[i] ?? "";
|
||||
value = item.points_extra?.[key] ?? 0;
|
||||
color = colors.warning;
|
||||
}
|
||||
const key = appSettings.pool_keys[i] ?? "";
|
||||
const value = key ? (item.points_extra?.[key] ?? 0) : 0;
|
||||
const color = i === 0 ? colors.success : i === 1 ? colors.info : colors.warning;
|
||||
return (
|
||||
<View key={i} style={styles.stat}>
|
||||
<Text style={[styles.statValue, { color }]}>{value}</Text>
|
||||
|
||||
@@ -28,6 +28,11 @@ export async function getExpoPushToken(): Promise<string | null> {
|
||||
});
|
||||
}
|
||||
|
||||
const tokenData = await Notifications.getExpoPushTokenAsync();
|
||||
return tokenData.data;
|
||||
try {
|
||||
const tokenData = await Notifications.getExpoPushTokenAsync();
|
||||
return tokenData.data;
|
||||
} catch {
|
||||
// Google Play Services absent (ex: GrapheneOS) — push non disponible
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user