Commit 3cb23dbb authored by chechunchi's avatar chechunchi

fix parsing ydk from mdproDeck

parent 2e1d3d4c
Pipeline #42378 passed with stages
in 2 minutes and 45 seconds
...@@ -247,7 +247,8 @@ const copyMdproDeckToEditing = async (mdproDeck: MdproDeckLike) => { ...@@ -247,7 +247,8 @@ const copyMdproDeckToEditing = async (mdproDeck: MdproDeckLike) => {
if (resp?.code !== 0) { if (resp?.code !== 0) {
message.error(resp?.message); message.error(resp?.message);
} else if (resp.data?.deckYdk !== undefined) { } else if (resp.data?.deckYdk !== undefined) {
const deck = YGOProDeck.fromYdkString(resp.data.deckYdk); const ydkString = resp.data.deckYdk.replace(/\\r\\n|\\r|\\n/g, "\n");
const deck = YGOProDeck.fromYdkString(ydkString);
if (!(deck.main.length + deck.extra.length + deck.side.length === 0)) { if (!(deck.main.length + deck.extra.length + deck.side.length === 0)) {
const deckName = mdproDeck.deckName; const deckName = mdproDeck.deckName;
......
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