From b7c6659e0408cf77b1976244ab84b0df1beb274c Mon Sep 17 00:00:00 2001 From: nicospz Date: Sat, 24 Jul 2021 01:26:54 +0900 Subject: [PATCH] Allow lowering constellation count with auto import wishes --- src/routes/characters/[id].svelte | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/routes/characters/[id].svelte b/src/routes/characters/[id].svelte index 527dbbed..e7dce3d0 100644 --- a/src/routes/characters/[id].svelte +++ b/src/routes/characters/[id].svelte @@ -77,7 +77,7 @@ let chars = {}; let constellationCount = -1; let manualCount = 0; - let editConstallation = false; + let editConstellation = false; const showedIndex = [1, 20, 21, 41, 42, 52, 53, 63, 64, 74, 75, 85, 86, 96]; const level = [1, 20, 20, 40, 40, 50, 50, 60, 60, 70, 70, 80, 80, 90]; @@ -99,11 +99,11 @@ } function editConstellationCount(val) { - manualCount = Math.max(0, manualCount + val); + manualCount = Math.max(manualCount + val); } async function saveConstellationCount() { - editConstallation = false; + editConstellation = false; if (chars[id]) { chars[id].manual = manualCount; } else if (defaultChars[id]) { @@ -135,7 +135,7 @@ await getConstellationCount(); }); - $: constellationCountTotal = constellationCount + manualCount; + $: constellationCountTotal = Math.max(0, constellationCount + manualCount); @@ -164,13 +164,13 @@ src="/images/elements/{character.element.id}.png" alt={character.element.name} /> -
+
{#if constellationCountTotal > -1}

C{constellationCountTotal}

{/if} - {#if editConstallation} + {#if editConstellation}