mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
Simplify Load button and remove skill error toast
This commit is contained in:
1 parent
3aee66b333
commit
07b0e1548b
2 files changed
+8
-13
No files matched your search
@@ -685,17 +685,15 @@ export const useLoadSkill = (
|
||||
const response = await client.sendCommand(sessionID, { command: skillName, arguments: "" });
|
||||
return { optimisticUserID, response };
|
||||
},
|
||||
onError: (error) => {
|
||||
onError: () => {
|
||||
if (sessionID) {
|
||||
const messagesQueryKey = ["opencode", "messages", opcodeUrl, sessionID, directory];
|
||||
setSessionStatus(sessionID!, { type: "idle" });
|
||||
setSessionStatus(sessionID!, { type: "idle" });
|
||||
queryClient.setQueryData<MessageWithParts[]>(
|
||||
messagesQueryKey,
|
||||
(old) => old?.filter((m) => !m.info.id.startsWith("optimistic_")),
|
||||
);
|
||||
}
|
||||
const message = error instanceof Error ? error.message : "Failed to load skill";
|
||||
showToast.error(message);
|
||||
},
|
||||
onSuccess: (data) => {
|
||||
const { response } = data;
|
||||
|
||||
Reference in new issue
Block a user