chore: build
Frontend Admin - EAS Build / build (push) Failing after 2h4m30s

This commit is contained in:
Nuxgrid
2026-07-18 22:36:36 +02:00
parent 48340317d8
commit 9c6deb59e6
@@ -90,14 +90,17 @@ export default function DeliveryScreen() {
weeks: LoginHistoryWeek[]; weeks: LoginHistoryWeek[];
} | null>(null); } | null>(null);
const [loginHistoryLoading, setLoginHistoryLoading] = useState(false); const [loginHistoryLoading, setLoginHistoryLoading] = useState(false);
const loginHistoryRequestRef = useRef(0);
const fetchLoginHistory = async ( const fetchLoginHistory = async (
username: string, username: string,
year: number, year: number,
month: number, month: number,
) => { ) => {
const requestId = ++loginHistoryRequestRef.current;
setLoginHistoryLoading(true); setLoginHistoryLoading(true);
const res = await getLivreurLoginHistory(username, year, month); const res = await getLivreurLoginHistory(username, year, month);
if (requestId !== loginHistoryRequestRef.current) return;
setLoginHistoryModal({ setLoginHistoryModal({
username, username,
year: res.year, year: res.year,
@@ -113,7 +116,7 @@ export default function DeliveryScreen() {
}; };
const changeLoginHistoryMonth = (delta: number) => { const changeLoginHistoryMonth = (delta: number) => {
if (!loginHistoryModal) return; if (!loginHistoryModal || loginHistoryLoading) return;
let year = loginHistoryModal.year; let year = loginHistoryModal.year;
let month = loginHistoryModal.month + delta; let month = loginHistoryModal.month + delta;
if (month < 1) { if (month < 1) {
@@ -123,6 +126,13 @@ export default function DeliveryScreen() {
month = 1; month = 1;
year += 1; year += 1;
} }
const now = new Date();
if (
year > now.getFullYear() ||
(year === now.getFullYear() && month > now.getMonth() + 1)
) {
return;
}
fetchLoginHistory(loginHistoryModal.username, year, month); fetchLoginHistory(loginHistoryModal.username, year, month);
}; };
@@ -1159,6 +1169,18 @@ export default function DeliveryScreen() {
</TouchableOpacity> </TouchableOpacity>
</View> </View>
{(() => {
const now = new Date();
const isCurrentMonth =
!!loginHistoryModal &&
loginHistoryModal.year ===
now.getFullYear() &&
loginHistoryModal.month ===
now.getMonth() + 1;
const canGoBack = !loginHistoryLoading;
const canGoForward =
!loginHistoryLoading && !isCurrentMonth;
return (
<View <View
style={{ style={{
flexDirection: "row", flexDirection: "row",
@@ -1168,12 +1190,20 @@ export default function DeliveryScreen() {
}} }}
> >
<TouchableOpacity <TouchableOpacity
onPress={() => changeLoginHistoryMonth(-1)} disabled={!canGoBack}
onPress={() =>
changeLoginHistoryMonth(-1)
}
hitSlop={8}
> >
<Ionicons <Ionicons
name="chevron-back" name="chevron-back"
size={20} size={20}
color={colors.textPrimary} color={
canGoBack
? colors.textPrimary
: colors.textMuted
}
/> />
</TouchableOpacity> </TouchableOpacity>
<Text <Text
@@ -1186,27 +1216,41 @@ export default function DeliveryScreen() {
{loginHistoryModal && {loginHistoryModal &&
new Date( new Date(
loginHistoryModal.year, loginHistoryModal.year,
loginHistoryModal.month - 1, loginHistoryModal.month -
1,
1, 1,
) )
.toLocaleDateString("fr-FR", { .toLocaleDateString(
"fr-FR",
{
month: "long", month: "long",
year: "numeric", year: "numeric",
}) },
)
.replace(/^./, (c) => .replace(/^./, (c) =>
c.toUpperCase(), c.toUpperCase(),
)} )}
</Text> </Text>
<TouchableOpacity <TouchableOpacity
onPress={() => changeLoginHistoryMonth(1)} disabled={!canGoForward}
onPress={() =>
changeLoginHistoryMonth(1)
}
hitSlop={8}
> >
<Ionicons <Ionicons
name="chevron-forward" name="chevron-forward"
size={20} size={20}
color={colors.textPrimary} color={
canGoForward
? colors.textPrimary
: colors.textMuted
}
/> />
</TouchableOpacity> </TouchableOpacity>
</View> </View>
);
})()}
{loginHistoryLoading ? ( {loginHistoryLoading ? (
<Text style={styles.ratingsEmpty}> <Text style={styles.ratingsEmpty}>