diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-09-07 15:54:22 +0530 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-09-07 15:54:22 +0530 |
commit | be77ee284a819f7932831bd85e88c47c655addb2 (patch) | |
tree | e0e57cdc9a2889a16c6640f1e2346df85054409e /packages/taler-wallet-core/src/util/time.ts | |
parent | d0088323ce02c6cc2cbe1413eddb0b81f3f147f2 (diff) | |
download | wallet-core-be77ee284a819f7932831bd85e88c47c655addb2.tar.xz |
dynamic pay request timeout
Diffstat (limited to 'packages/taler-wallet-core/src/util/time.ts')
-rw-r--r-- | packages/taler-wallet-core/src/util/time.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/taler-wallet-core/src/util/time.ts b/packages/taler-wallet-core/src/util/time.ts index 5a5e9c608..be63aef6b 100644 --- a/packages/taler-wallet-core/src/util/time.ts +++ b/packages/taler-wallet-core/src/util/time.ts @@ -151,6 +151,13 @@ export function durationMul(d: Duration, n: number): Duration { return { d_ms: Math.round(d.d_ms * n) }; } +export function durationAdd(d1: Duration, d2: Duration): Duration { + if (d1.d_ms === "forever" || d2.d_ms === "forever") { + return { d_ms: "forever" }; + } + return { d_ms: d1.d_ms + d2.d_ms }; +} + export function timestampCmp(t1: Timestamp, t2: Timestamp): number { if (t1.t_ms === "never") { if (t2.t_ms === "never") { |