summaryrefslogtreecommitdiff
path: root/front/src/routes/keys.jsx
diff options
context:
space:
mode:
authorElizabeth (Lizzy) Hunt <elizabeth.hunt@simponic.xyz>2023-05-29 16:28:27 -0700
committerGitHub <noreply@github.com>2023-05-29 16:28:27 -0700
commiteec32aa38a8762eccc8575a37a628bd5ae2cc1d0 (patch)
tree27f656780f5d25325c9ac0ec3db3557d774bf414 /front/src/routes/keys.jsx
parent8a5a2f358cb1f63a255b2daf6908536583986448 (diff)
downloadchessh-eec32aa38a8762eccc8575a37a628bd5ae2cc1d0.tar.gz
chessh-eec32aa38a8762eccc8575a37a628bd5ae2cc1d0.zip
Bots (#23)
* squash all the things for bots * fix warnings * change colors a bit and README updates * fix frontend warnings
Diffstat (limited to 'front/src/routes/keys.jsx')
-rw-r--r--front/src/routes/keys.jsx10
1 files changed, 4 insertions, 6 deletions
diff --git a/front/src/routes/keys.jsx b/front/src/routes/keys.jsx
index 5b50fa9..b9d4542 100644
--- a/front/src/routes/keys.jsx
+++ b/front/src/routes/keys.jsx
@@ -14,16 +14,14 @@ const minimizeKey = (key) => {
return key;
};
-const KeyCard = ({ onDelete, props }) => {
- const { id, name, key } = props;
-
+const KeyCard = ({ onDelete, keyStruct: { id, name, key } }) => {
const deleteThisKey = () => {
if (
window.confirm(
"Are you sure? This will close all your currently opened ssh sessions."
)
) {
- fetch(`/api/keys/${id}`, {
+ fetch(`/api/player/keys/${id}`, {
credentials: "same-origin",
method: "DELETE",
})
@@ -182,7 +180,7 @@ export const Keys = () => {
}
}, [userId, refreshKeys]);
- if (!keys) return <p>Loading...</p>;
+ if (keys === null) return <p>Loading...</p>;
if (Array.isArray(keys)) {
return (
@@ -192,7 +190,7 @@ export const Keys = () => {
<div className="key-card-collection">
{keys.length ? (
keys.map((key) => (
- <KeyCard key={key.id} onDelete={refreshKeys} props={key} />
+ <KeyCard key={key.id} onDelete={refreshKeys} keyStruct={key} />
))
) : (
<p>Looks like you've got no keys, try adding some!</p>