Update delete logic for text and folders

This commit is contained in:
2026-02-01 04:39:55 +01:00
parent 3a30d6799e
commit d9ee24e7cb

View File

@@ -1355,11 +1355,8 @@ export default function App() {
className="prompt-item__delete" className="prompt-item__delete"
onClick={(event) => { onClick={(event) => {
event.stopPropagation(); event.stopPropagation();
setConfirmState({ requestDeleteText(text).catch((error) => {
title: "Delete text", console.error("Failed to delete text", error);
message: `Delete \"${text.title}\"? This removes all versions and drafts.`,
actionLabel: "Delete text",
onConfirm: () => handleDeleteText(text.id)
}); });
}} }}
aria-label="Delete text" aria-label="Delete text"
@@ -1436,12 +1433,8 @@ export default function App() {
className="folder-item__delete" className="folder-item__delete"
onClick={(event) => { onClick={(event) => {
event.stopPropagation(); event.stopPropagation();
setConfirmState({ requestDeleteFolder(folder).catch((error) => {
title: "Delete folder", console.error("Failed to delete folder", error);
message:
"Delete this folder? Its subfolders and texts will move one level up.",
actionLabel: "Delete folder",
onConfirm: () => handleDeleteFolder(folder.id)
}); });
}} }}
aria-label="Delete folder" aria-label="Delete folder"