mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-29 19:35:20 +02:00
Merge pull request #1439 from AnishSarkar22/fix/mention-documents
feat: improve composer mentions and connector account selection
This commit is contained in:
commit
820f541f08
22 changed files with 1533 additions and 783 deletions
|
|
@ -1063,6 +1063,7 @@ function AuthenticatedDocumentsSidebarBase({
|
|||
const treeDocMap = new Map(treeDocuments.map((d) => [d.id, d]));
|
||||
return sidebarDocs
|
||||
.filter((doc) => {
|
||||
if (doc.kind !== "doc") return false;
|
||||
const fullDoc = treeDocMap.get(doc.id);
|
||||
if (!fullDoc) return false;
|
||||
const state = fullDoc.status?.state ?? "ready";
|
||||
|
|
@ -1124,7 +1125,7 @@ function AuthenticatedDocumentsSidebarBase({
|
|||
try {
|
||||
await deleteDocumentMutation({ id });
|
||||
toast.success(t("delete_success") || "Document deleted");
|
||||
setSidebarDocs((prev) => prev.filter((d) => d.id !== id));
|
||||
setSidebarDocs((prev) => prev.filter((d) => d.kind !== "doc" || d.id !== id));
|
||||
return true;
|
||||
} catch (e) {
|
||||
console.error("Error deleting document:", e);
|
||||
|
|
@ -1953,7 +1954,7 @@ function AnonymousDocumentsSidebar({
|
|||
onEditDocument={() => gate("edit documents")}
|
||||
onDeleteDocument={async () => {
|
||||
handleRemoveDoc();
|
||||
setSidebarDocs((prev) => prev.filter((d) => d.id !== -1));
|
||||
setSidebarDocs((prev) => prev.filter((d) => d.kind !== "doc" || d.id !== -1));
|
||||
return true;
|
||||
}}
|
||||
onMoveDocument={() => gate("organize documents")}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue