WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 0a6b0dc

Browse files
authored
Use cloud storage provider internal name (#6108)
Don't show in changelog
1 parent 02e9972 commit 0a6b0dc

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

newIDE/app/src/VersionHistory/UseVersionHistory.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,17 @@ import useAlertDialog from '../UI/Alert/useAlertDialog';
2323
import PlaceholderLoader from '../UI/PlaceholderLoader';
2424
import type { MessageDescriptor } from '../Utils/i18n/MessageDescriptor.flow';
2525
import PlaceholderError from '../UI/PlaceholderError';
26+
import CloudStorageProvider from '../ProjectsStorage/CloudStorageProvider';
2627

2728
const getCloudProjectFileMetadataIdentifier = (
2829
storageProviderInternalName: string,
2930
fileMetadata: ?FileMetadata
3031
) => {
31-
if (!fileMetadata || !storageProviderInternalName === 'Cloud') return null;
32+
if (
33+
!fileMetadata ||
34+
!storageProviderInternalName === CloudStorageProvider.internalName
35+
)
36+
return null;
3237
if (fileMetadata.fileIdentifier.startsWith('http')) {
3338
// When creating a cloud project from an example, there might be a moment where
3439
// the used Storage Provider is the cloud one but the file identifier is the url
@@ -115,7 +120,8 @@ const useVersionHistory = ({
115120
setVersionHistoryPanelOpen,
116121
] = React.useState<boolean>(false);
117122
const storageProviderInternalName = storageProvider.internalName;
118-
const isCloudProject = storageProviderInternalName === 'Cloud';
123+
const isCloudProject =
124+
storageProviderInternalName === CloudStorageProvider.internalName;
119125
const isUserAllowedToSeeVersionHistory = canUseCloudProjectHistory(
120126
subscription
121127
);

0 commit comments

Comments
 (0)