diff --git a/packages/client/src/components/dialogs/CreateEditRoomDialog/sub-components/PermanentSettings/index.js b/packages/client/src/components/dialogs/CreateEditRoomDialog/sub-components/PermanentSettings/index.js index 998df6e4e0..45b20f1fcc 100644 --- a/packages/client/src/components/dialogs/CreateEditRoomDialog/sub-components/PermanentSettings/index.js +++ b/packages/client/src/components/dialogs/CreateEditRoomDialog/sub-components/PermanentSettings/index.js @@ -10,7 +10,7 @@ import { import PermanentSetting from "./PermanentSetting"; const StyledPermanentSettings = styled.div` - display: flex; + display: ${(props) => (props.displayNone ? "none" : "flex")}; flex-direction: row; gap: 8px; margin-top: -12px; @@ -23,16 +23,6 @@ const PermanentSettings = ({ storageLocation, isPrivate, }) => { - const thirdpartyTitle = isThirdparty - ? getProviderTypeTitle(storageLocation.providerKey, t) - : ""; - - const thirdpartyIcon = isThirdparty - ? getProviderTypeIcon(storageLocation.providerKey) - : ""; - - const thirdpartyFolderName = isThirdparty ? storageLocation.title : ""; - const createThirdpartyPath = () => { const path = storageLocation.parentId.split("|"); path.shift(); @@ -41,10 +31,13 @@ const PermanentSettings = ({ return `(${path.join("/")})`; }; + const thirdpartyTitle = getProviderTypeTitle(storageLocation?.providerKey, t); + const thirdpartyIcon = getProviderTypeIcon(storageLocation?.providerKey); + const thirdpartyFolderName = isThirdparty ? storageLocation?.title : ""; const thirdpartyPath = isThirdparty ? createThirdpartyPath() : ""; return ( - + {isThirdparty && (