From ba4a9bd9c60335d1ca889eacc3f18b1c90bb1f51 Mon Sep 17 00:00:00 2001 From: binarybaron <86064887+binarybaron@users.noreply.github.com> Date: Fri, 6 Sep 2024 23:55:36 +0200 Subject: [PATCH] feat(gui): Only display alert on history page if funds have been locked (#66) --- src-gui/src/renderer/components/alert/SwapStatusAlert.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src-gui/src/renderer/components/alert/SwapStatusAlert.tsx b/src-gui/src/renderer/components/alert/SwapStatusAlert.tsx index e6a5774a..8453331e 100644 --- a/src-gui/src/renderer/components/alert/SwapStatusAlert.tsx +++ b/src-gui/src/renderer/components/alert/SwapStatusAlert.tsx @@ -4,6 +4,7 @@ import { GetSwapInfoResponse } from "models/tauriModel"; import { BobStateName, GetSwapInfoResponseExt, + isGetSwapInfoResponseRunningSwap, TimelockCancel, TimelockNone, } from "models/tauriModelExt"; @@ -206,7 +207,7 @@ export default function SwapStatusAlert({ // If the swap is completed, there is no need to display the alert // TODO: Here we should also check if the swap is in a state where any funds can be lost // TODO: If the no Bitcoin have been locked yet, we can safely ignore the swap - if (swap.completed) { + if (!isGetSwapInfoResponseRunningSwap(swap)) { return null; }