fix(webui): skip confirmation for undoable topic deletion (#6723)
* fix(webui): skip confirmation for undoable topic deletion * refactor(webui): rely on gateway for linked automation confirmation
This commit is contained in:
1 parent
f9052884ba
commit
eb82ab84cc
19 files changed
+113
-233
No files matched your search
@@ -5,14 +5,12 @@ import { useNanobotStream } from "@/hooks/useNanobotStream";
|
||||
import {
|
||||
ApiError,
|
||||
deleteSession as apiDeleteSession,
|
||||
fetchSessionAutomations,
|
||||
listSessions,
|
||||
} from "@/lib/api";
|
||||
import { webuiThreadCache } from "@/lib/webui-thread-cache";
|
||||
import { readReloadSessions, writeReloadCache } from "@/lib/reload-cache";
|
||||
import type {
|
||||
ChatSummary,
|
||||
SessionAutomationJob,
|
||||
SessionDeleteResult,
|
||||
WorkspaceScopePayload,
|
||||
} from "@/lib/types";
|
||||
@@ -34,7 +32,6 @@ export function useSessions(): {
|
||||
key: string,
|
||||
options?: { deleteAutomations?: boolean },
|
||||
) => Promise<SessionDeleteResult>;
|
||||
getSessionAutomations: (key: string) => Promise<SessionAutomationJob[]>;
|
||||
} {
|
||||
const { client, token } = useClient();
|
||||
const [sessions, setSessions] = useState<ChatSummary[]>(readReloadSessions);
|
||||
@@ -187,11 +184,6 @@ export function useSessions(): {
|
||||
[client],
|
||||
);
|
||||
|
||||
const getSessionAutomations = useCallback(async (key: string) => {
|
||||
const result = await fetchSessionAutomations(tokenRef.current, key);
|
||||
return result.jobs;
|
||||
}, []);
|
||||
|
||||
return {
|
||||
sessions,
|
||||
loading,
|
||||
@@ -201,7 +193,6 @@ export function useSessions(): {
|
||||
createChat,
|
||||
forkChat,
|
||||
deleteChat,
|
||||
getSessionAutomations,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user