From f564944c98baf91d00f44d03645df236980333d5 Mon Sep 17 00:00:00 2001 From: Akmal Isomadinov Date: Wed, 24 Jul 2024 18:00:52 +0500 Subject: [PATCH] Client Fixed Bug 69365 --- packages/client/src/store/ContextOptionsStore.js | 11 ++++++++++- packages/client/src/store/FilesStore.js | 2 ++ packages/client/src/store/PublicRoomStore.js | 9 ++++++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/packages/client/src/store/ContextOptionsStore.js b/packages/client/src/store/ContextOptionsStore.js index 75ef219f94..c0be163395 100644 --- a/packages/client/src/store/ContextOptionsStore.js +++ b/packages/client/src/store/ContextOptionsStore.js @@ -116,6 +116,13 @@ const LOADER_TIMER = 500; let loadingTime; let timer; +const systemFolders = [ + FolderType.InProgress, + FolderType.Done, + FolderType.SubFolderDone, + FolderType.SubFolderInProgress, +]; + class ContextOptionsStore { settingsStore; dialogsStore; @@ -409,7 +416,9 @@ class ContextOptionsStore { const isShared = shared || sharedItem; - if (isShared && !isArchive) { + const isSystemFolder = systemFolders.includes(item.type); + + if (isShared && !isArchive && !isSystemFolder) { try { const itemLink = item.isFolder ? await getFolderLink(item.id) diff --git a/packages/client/src/store/FilesStore.js b/packages/client/src/store/FilesStore.js index e186d1bd5c..24db897f0f 100644 --- a/packages/client/src/store/FilesStore.js +++ b/packages/client/src/store/FilesStore.js @@ -1723,6 +1723,8 @@ class FilesStore { ].includes(err?.response?.status); if (isUserError && !isThirdPartyError) { + if (isPublicRoom()) return Promise.reject(err); + this.setIsErrorRoomNotAvailable(true); } else { if (axios.isCancel(err)) { diff --git a/packages/client/src/store/PublicRoomStore.js b/packages/client/src/store/PublicRoomStore.js index 663ea2ef84..2cc6db00d3 100644 --- a/packages/client/src/store/PublicRoomStore.js +++ b/packages/client/src/store/PublicRoomStore.js @@ -29,6 +29,7 @@ import { makeAutoObservable } from "mobx"; import api from "@docspace/shared/api"; import FilesFilter from "@docspace/shared/api/files/filter"; +import { combineUrl } from "@docspace/shared/utils/combineUrl"; import { frameCallCommand, isPublicRoom as isPublicRoomUtil, @@ -124,7 +125,13 @@ class PublicRoomStore { if (filter) { const folderId = filter.folder; - return fetchFiles(folderId, filter); + return fetchFiles(folderId, filter).catch((error) => { + if (error.response.status === 403) { + window.location.replace( + combineUrl(window.ClientConfig?.proxy?.url, "/login"), + ); + } + }); } return Promise.resolve();