Commit 66d418aa authored by Chunchi Che's avatar Chunchi Che

fix card alias

parent 0145b453
Pipeline #23396 passed with stages
in 21 minutes and 58 seconds
...@@ -8,6 +8,7 @@ export interface CardMeta { ...@@ -8,6 +8,7 @@ export interface CardMeta {
} }
export interface CardData { export interface CardData {
alias?: number;
ot?: number; ot?: number;
setcode?: number; setcode?: number;
type?: number; type?: number;
......
...@@ -94,8 +94,14 @@ export const editDeckStore = proxy({ ...@@ -94,8 +94,14 @@ export const editDeckStore = proxy({
const max = 3; // 这里无需参考禁卡表 const max = 3; // 这里无需参考禁卡表
const numOfSameCards = const numOfSameCards =
editDeckStore.getAll().filter((c) => c.id === card.id).length - editDeckStore
(source !== "search" ? 1 : 0); .getAll()
.filter(
(c) =>
c.id === card.id ||
c.data.alias === card.id ||
c.id === card.data.alias,
).length - (source !== "search" ? 1 : 0);
if (numOfSameCards >= max) { if (numOfSameCards >= max) {
result = false; result = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment