Skip to content

Commit

Permalink
Fix resource opening on iOS and opening of urls (#5245)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandreSi committed Apr 19, 2023
1 parent b2e8c23 commit f8de6c2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import { Trans, t } from '@lingui/macro';
import { type AuthenticatedUser } from '../../Profile/AuthenticatedUserContext';
import { type ResourcesActionsProps } from '../../ProjectsStorage';
import optionalRequire from '../../Utils/OptionalRequire';
import { getCredentialsForCloudProject } from '../../Utils/GDevelopServices/Project';
import { downloadUrlsToLocalFiles } from '../../Utils/LocalFileDownloader';
import { checkIfIsGDevelopCloudBucketUrl } from '../../Utils/CrossOrigin';
import Window from '../../Utils/Window';
import ResourcesLoader from '../../ResourcesLoader';

Expand Down Expand Up @@ -42,18 +40,6 @@ export const generateGetResourceActions = ({
resource.getName(),
{}
);
if (checkIfIsGDevelopCloudBucketUrl(resourceUrl)) {
await getCredentialsForCloudProject(
authenticatedUser,
fileMetadata.fileIdentifier
);
// Recompute full url to include a refreshed token.
resourceUrl = ResourcesLoader.getResourceFullUrl(
project,
resource.getName(),
{}
);
}
if (app && path && electron) {
const defaultPath = path.join(
app.getPath('downloads'),
Expand Down
3 changes: 2 additions & 1 deletion newIDE/app/src/UI/CloseConfirmDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { type I18n as I18nType } from '@lingui/core';
import * as React from 'react';
import optionalRequire from '../Utils/OptionalRequire';
import Window from '../Utils/Window';
import { isNativeMobileApp } from '../Utils/Platform';
const electron = optionalRequire('electron');
const remote = optionalRequire('@electron/remote');

Expand Down Expand Up @@ -56,7 +57,7 @@ export default React.memo<Props>(function CloseConfirmDialog({
// Returning undefined will let the window close
}
};
} else if (window) {
} else if (window && !isNativeMobileApp()) {
if (shouldPrompt) {
window.onbeforeunload = () => message;
} else {
Expand Down

0 comments on commit f8de6c2

Please sign in to comment.