UI - МЕЖПРОЕКТНАЯ КОММУНИКАЦИЯ: внешний контур, auth empty state и HDESIGN update
This commit is contained in:
@@ -28,20 +28,31 @@ export const ExternalContoursRoot = observer(function ExternalContoursRoot(props
|
||||
const { workspaceSlug, projectId, inboxIssueId, navigationTab } = props;
|
||||
const [isMobileSidebar, setIsMobileSidebar] = useState(true);
|
||||
const { t } = useTranslation();
|
||||
const { loader, error, currentTab, currentProjectId, handleCurrentTab, fetchRequests } = useProjectExternalContours();
|
||||
const { loader, error, currentTab, currentProjectId, requestIds, handleCurrentTab, fetchRequests } =
|
||||
useProjectExternalContours();
|
||||
|
||||
useEffect(() => {
|
||||
if (!workspaceSlug || !projectId) return;
|
||||
|
||||
const resolvedTab = navigationTab || EInboxIssueCurrentTab.OPEN;
|
||||
const hasProjectChanged = currentProjectId && currentProjectId !== projectId;
|
||||
|
||||
if (navigationTab && navigationTab !== currentTab) {
|
||||
handleCurrentTab(workspaceSlug, projectId, navigationTab);
|
||||
} else if (hasProjectChanged) {
|
||||
handleCurrentTab(workspaceSlug, projectId, EInboxIssueCurrentTab.OPEN);
|
||||
} else {
|
||||
fetchRequests(workspaceSlug.toString(), projectId.toString(), navigationTab || EInboxIssueCurrentTab.OPEN);
|
||||
if (hasProjectChanged) {
|
||||
void handleCurrentTab(workspaceSlug, projectId, EInboxIssueCurrentTab.OPEN);
|
||||
return;
|
||||
}
|
||||
|
||||
if (currentProjectId === projectId && currentTab === resolvedTab) {
|
||||
if (loader === "init-loading") return;
|
||||
if (requestIds.length > 0) return;
|
||||
}
|
||||
|
||||
if (currentTab !== resolvedTab) {
|
||||
void handleCurrentTab(workspaceSlug, projectId, resolvedTab);
|
||||
return;
|
||||
}
|
||||
|
||||
void fetchRequests(workspaceSlug.toString(), projectId.toString(), resolvedTab);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [workspaceSlug, projectId, navigationTab]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user