From dbc54b016c9484c48a101606ee1fc0a82951fccb Mon Sep 17 00:00:00 2001 From: Azalea <22280294+hykilpikonna@users.noreply.github.com> Date: Thu, 22 Feb 2024 12:30:28 -0500 Subject: [PATCH] [O] Check if already linked --- AquaNet/src/components/BindCard.svelte | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/AquaNet/src/components/BindCard.svelte b/AquaNet/src/components/BindCard.svelte index c21ccc6f..899af9e8 100644 --- a/AquaNet/src/components/BindCard.svelte +++ b/AquaNet/src/components/BindCard.svelte @@ -41,6 +41,13 @@ console.log("linking card", id) + // Check if this card is already linked in the account + if (me?.cards?.some(c => formatLUID(c.luid).toLowerCase() === id.toLowerCase())) { + setError("This card is already linked to your account", type) + state = "ready" + return + } + // First, lookup the card summary const card = (await CARD.summary(id).catch(e => { // If card is not found,