Don't show save reminders in quick customization

This commit is contained in:
Florian Rival
2024-10-24 17:17:24 +02:00
parent ab519d41a1
commit 53eafe098c
3 changed files with 13 additions and 7 deletions

View File

@@ -11,7 +11,11 @@ import { useInterval } from '../Utils/UseInterval';
export type UnsavedChangesAmount = 'none' | 'small' | 'significant' | 'risky';
type Props = {| onSave: () => Promise<void>, project: ?gdProject |};
type Props = {|
onSave: () => Promise<void>,
project: ?gdProject,
isInQuickCustomization: boolean,
|};
const ONE_MINUTE = 60 * 1000;
const MINIMUM_CHANGES_FOR_SIGNIFICANT_STATUS = 12;
@@ -43,7 +47,11 @@ export const getUnsavedChangesAmount = (
}
};
const useSaveReminder = ({ onSave, project }: Props) => {
const useSaveReminder = ({
onSave,
project,
isInQuickCustomization,
}: Props) => {
const unsavedChanges = React.useContext(UnsavedChangesContext);
const { currentlyRunningInAppTutorial } = React.useContext(
InAppTutorialContext
@@ -62,6 +70,7 @@ const useSaveReminder = ({ onSave, project }: Props) => {
if (
!displaySaveReminderPreference.activated ||
isInQuickCustomization ||
currentlyRunningInAppTutorial ||
!project
) {

View File

@@ -2874,6 +2874,7 @@ const MainFrame = (props: Props) => {
const renderSaveReminder = useSaveReminder({
onSave: saveProject,
project: currentProject,
isInQuickCustomization: !!quickCustomizationDialogOpenedFromGameId,
});
/**

View File

@@ -1002,11 +1002,7 @@ export default class SceneEditor extends React.Component<Props, State> {
global: boolean,
i18n: I18nType
) => {
const {
project,
layout,
projectScopedContainersAccessor,
} = this.props;
const { project, layout, projectScopedContainersAccessor } = this.props;
const objectsContainersList = projectScopedContainersAccessor
.get()