We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 04d9051 + a1ac948 commit 038ceadCopy full SHA for 038cead
βsrc/frontend/utils/CardManager.js
@@ -46,6 +46,21 @@ const CardManager = class {
46
}
47
48
updateCardInformation(cardIDs) {
49
+ const cardQuantityDifference = cardIDs.length - this.submittedCards.length;
50
+
51
+ if (cardQuantityDifference > 0) {
52
+ Array.from({ length: cardQuantityDifference }).forEach(() =>
53
+ this.dropNewCard(),
54
+ );
55
+ }
56
57
+ if (cardQuantityDifference < 0) {
58
+ this.submittedCards
59
+ .slice(0, -cardQuantityDifference)
60
+ .forEach((card) => card.delete());
61
+ this.submittedCards = this.submittedCards.slice(-cardQuantityDifference);
62
63
64
this.submittedCards.forEach((card, idx) =>
65
card.setCardInformation(cardIDs[idx]),
66
);
0 commit comments