mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-16 02:40:39 +09:00
Address valid Greptile portability follow-ups
This commit is contained in:
parent
92c29f27c3
commit
87b3cacc8f
3 changed files with 15 additions and 12 deletions
|
|
@ -356,6 +356,7 @@ function applyImportedSidebarOrder(
|
|||
) {
|
||||
const sidebar = preview?.manifest.sidebar;
|
||||
if (!sidebar) return;
|
||||
if (!userId?.trim()) return;
|
||||
|
||||
const agentIdBySlug = new Map(
|
||||
result.agents
|
||||
|
|
@ -846,7 +847,18 @@ export function CompanyImport() {
|
|||
onSuccess: async (result) => {
|
||||
await queryClient.invalidateQueries({ queryKey: queryKeys.companies.all });
|
||||
const importedCompany = await companiesApi.get(result.company.id);
|
||||
applyImportedSidebarOrder(importPreview, result, currentUserId);
|
||||
const refreshedSession = currentUserId
|
||||
? null
|
||||
: await queryClient.fetchQuery({
|
||||
queryKey: queryKeys.auth.session,
|
||||
queryFn: () => authApi.getSession(),
|
||||
});
|
||||
const sidebarOrderUserId =
|
||||
currentUserId
|
||||
?? refreshedSession?.user?.id
|
||||
?? refreshedSession?.session?.userId
|
||||
?? null;
|
||||
applyImportedSidebarOrder(importPreview, result, sidebarOrderUserId);
|
||||
setSelectedCompanyId(importedCompany.id);
|
||||
pushToast({
|
||||
tone: "success",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue