Skip to content

Commit 2480b84

Browse files
authored
Save custom decks to the database (#818)
* Deck builder changes * Deck public status * wip * wip * toasts * spinner * wip * wip * Tabs and prettier list * Prepare public decks * Public decks * Error alert * Deck view page * Improve like button * Liked decks page * wip * wip * wip * filter by energy * responsive view * order * Improve ui * Override bugged deckbuilding promos * Adjust rarity filter for deckbuilding mode * Fix saving deck * Validate decks with zod * Validate decks with zod * Remove commented out code * Fix on delete invalidate * New deck name Sets the default name of a new deck to an empty string to motivate the user to set the name to something different than "New deck" * Deck name placeholder * Fix deck copy * Fix on update invalidate
1 parent 642f3b5 commit 2480b84

File tree

12 files changed

+642
-195
lines changed

12 files changed

+642
-195
lines changed

frontend/assets/cards.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8013,7 +8013,7 @@
80138013
"baby": false,
80148014
"set_details": "geneticapex(a1)",
80158015
"pack": "everypack",
8016-
"alternate_versions": [83654, 133058],
8016+
"alternate_versions": [133058, 83654],
80178017
"artist": "Amelicart",
80188018
"internal_id": 83654
80198019
},
@@ -8985,7 +8985,7 @@
89858985
"baby": false,
89868986
"set_details": "mythicalisland(a1a)",
89878987
"pack": "mewpack",
8988-
"alternate_versions": [83654, 133058],
8988+
"alternate_versions": [133058, 83654],
89898989
"artist": "Saya Tsuruta",
89908990
"internal_id": 133058
89918991
},
@@ -22230,7 +22230,7 @@
2223022230
"baby": false,
2223122231
"set_details": "shiningrevelry(a2b)",
2223222232
"pack": "everypack",
22233-
"alternate_versions": [334796, 12583248],
22233+
"alternate_versions": [12583248, 334796],
2223422234
"artist": "Toyste Beach",
2223522235
"internal_id": 334796
2223622236
},
@@ -55293,7 +55293,7 @@
5529355293
"baby": false,
5529455294
"set_details": "deluxepack:ex",
5529555295
"pack": "everypack",
55296-
"alternate_versions": [744773, 12583376],
55296+
"alternate_versions": [12583376, 744773],
5529755297
"artist": "Akira Komayama",
5529855298
"internal_id": 744773
5529955299
},
@@ -67859,7 +67859,7 @@
6785967859
"baby": false,
6786067860
"set_details": "promo-a",
6786167861
"pack": "everypack",
67862-
"alternate_versions": [334796, 12583248],
67862+
"alternate_versions": [12583248, 334796],
6786367863
"artist": "Ryo Ueda",
6786467864
"internal_id": 12583248
6786567865
},
@@ -67905,7 +67905,7 @@
6790567905
"baby": false,
6790667906
"set_details": "promo-a",
6790767907
"pack": "everypack",
67908-
"alternate_versions": [744773, 12583376],
67908+
"alternate_versions": [12583376, 744773],
6790967909
"artist": "Naoki Saito",
6791067910
"internal_id": 12583376
6791167911
},

frontend/src/App.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { Header } from './components/Header.tsx'
1212
import { Spinner } from './components/Spinner.tsx'
1313
import { Toaster } from './components/ui/toaster.tsx'
1414
import { DialogContext } from './context/DialogContext.ts'
15+
import DeckView from './pages/decks/DeckView.tsx'
1516

1617
// Lazy import for chunking
1718
const Overview = lazy(() => import('./pages/overview/Overview.tsx'))
@@ -82,7 +83,8 @@ function App() {
8283
{ path: '/collection/:friendId?', element: <Collection /> },
8384
{ path: '/collection/:friendId/trade', element: <TradeWithRedirect /> }, // support old trading path
8485
{ path: '/decks', element: <Decks /> },
85-
{ path: '/decks/edit', element: <DeckBuilder /> },
86+
{ path: '/decks/edit/:id?', element: <DeckBuilder /> },
87+
{ path: '/decks/:id', element: <DeckView /> },
8688
{ path: '/scan', element: <Scan /> },
8789
{ path: '/trade/*', element: <Trade /> },
8890
],

frontend/src/components/filters/RarityFilter.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,7 @@ const RarityFilter: FC<Props> = ({ rarities, rarityFilter, setRarityFilter, deck
1919
setRarityFilter(rarityFilter.filter((rf) => basicRarities.includes(rf)))
2020
}
2121
}, [deckbuildingMode])
22-
23-
// #735: There is currently a problem with a few cards being collapsed to a full-art rarity, insead of basic or promo
24-
// const raritiesToUse: readonly Rarity[] = rarities ?? (deckbuildingMode ? basicRarities : allRarities)
25-
const raritiesToUse: readonly Rarity[] = rarities ?? allRarities
26-
22+
const raritiesToUse: readonly Rarity[] = rarities ?? (deckbuildingMode ? basicRarities : allRarities)
2723
return <ToggleFilter className={className} options={raritiesToUse} value={rarityFilter} onChange={setRarityFilter} show={formatRarity} asChild />
2824
}
2925

0 commit comments

Comments
 (0)