Handle subdirectories of emoji in copying, fetching and deleting. For #1916

This commit is contained in:
Gabe Kangas
2022-12-16 20:22:21 -08:00
parent 71be5e4b41
commit 0ebb968074
3 changed files with 62 additions and 22 deletions

View File

@@ -51,7 +51,10 @@ const Emoji = () => {
getEmojis();
}, []);
async function handleDelete(name: string) {
async function handleDelete(fullPath: string) {
const name = `/${fullPath.split('/').slice(3).join('/')}`;
console.log(name);
setLoading(true);
setSubmitStatus(createInputStatus(STATUS_PROCESSING, 'Deleting emoji...'));
@@ -128,7 +131,7 @@ const Emoji = () => {
key: 'delete',
render: (text, record) => (
<Space size="middle">
<Button onClick={() => handleDelete(record.name)} icon={<DeleteOutlined />} />
<Button onClick={() => handleDelete(record.url)} icon={<DeleteOutlined />} />
</Space>
),
},