Skip to content

Commit

Permalink
Use cloud storage provider internal name (#6108)
Browse files Browse the repository at this point in the history
Don't show in changelog
  • Loading branch information
AlexandreSi authored Dec 20, 2023
1 parent 02e9972 commit 0a6b0dc
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions newIDE/app/src/VersionHistory/UseVersionHistory.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,17 @@ import useAlertDialog from '../UI/Alert/useAlertDialog';
import PlaceholderLoader from '../UI/PlaceholderLoader';
import type { MessageDescriptor } from '../Utils/i18n/MessageDescriptor.flow';
import PlaceholderError from '../UI/PlaceholderError';
import CloudStorageProvider from '../ProjectsStorage/CloudStorageProvider';

const getCloudProjectFileMetadataIdentifier = (
storageProviderInternalName: string,
fileMetadata: ?FileMetadata
) => {
if (!fileMetadata || !storageProviderInternalName === 'Cloud') return null;
if (
!fileMetadata ||
!storageProviderInternalName === CloudStorageProvider.internalName
)
return null;
if (fileMetadata.fileIdentifier.startsWith('http')) {
// When creating a cloud project from an example, there might be a moment where
// the used Storage Provider is the cloud one but the file identifier is the url
Expand Down Expand Up @@ -115,7 +120,8 @@ const useVersionHistory = ({
setVersionHistoryPanelOpen,
] = React.useState<boolean>(false);
const storageProviderInternalName = storageProvider.internalName;
const isCloudProject = storageProviderInternalName === 'Cloud';
const isCloudProject =
storageProviderInternalName === CloudStorageProvider.internalName;
const isUserAllowedToSeeVersionHistory = canUseCloudProjectHistory(
subscription
);
Expand Down

0 comments on commit 0a6b0dc

Please sign in to comment.