fix: protocol min was returning never

This commit is contained in:
Sebastian 2023-02-20 13:23:01 -03:00
parent 68f3c3b447
commit 26aca142fe
No known key found for this signature in database
GPG Key ID: BE4FF68352439FC1

View File

@ -64,10 +64,19 @@ export namespace TalerProtocolTimestamp {
return { t_s: t2.t_s };
}
if (t2.t_s === "never") {
return { t_s: t2.t_s };
return { t_s: t1.t_s };
}
return { t_s: Math.min(t1.t_s, t2.t_s) };
}
export function max(
t1: TalerProtocolTimestamp,
t2: TalerProtocolTimestamp,
): TalerProtocolTimestamp {
if (t1.t_s === "never" || t2.t_s === "never") {
return { t_s: "never" };
}
return { t_s: Math.max(t1.t_s, t2.t_s) };
}
}
export interface Duration {