Skip to content

Commit c52a993

Browse files
committed
Add mode selector when starting a new chat with an opened project
Don't show in changelog
1 parent 7dd4f87 commit c52a993

File tree

1 file changed

+8
-11
lines changed
  • newIDE/app/src/AiGeneration/AiRequestChat

1 file changed

+8
-11
lines changed

newIDE/app/src/AiGeneration/AiRequestChat/index.js

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ const getPriceAndRequestsTextAndTooltip = ({
111111
<Trans>{aiCreditsAvailable} AI credits available</Trans>
112112
);
113113
const creditsText = (
114-
<Trans>{Math.max(0, availableCredits)} GDevelop credits available</Trans>
114+
<Trans>{Math.max(0, availableCredits)} credits available</Trans>
115115
);
116116

117117
const timeForReset = quota.resetsAt ? new Date(quota.resetsAt) : null;
@@ -450,12 +450,8 @@ export const AiRequestChat = React.forwardRef<Props, AiRequestChatInterface>(
450450
? actionsOnExistingProject
451451
: actionsToCreateAProject
452452
: hasOpenedProject && !standAloneForm
453-
? [
454-
...questionsOnExistingProject,
455-
...actionsOnExistingProject,
456-
...generalQuestions,
457-
]
458-
: [...generalQuestions, ...actionsToCreateAProject];
453+
? [...questionsOnExistingProject, ...generalQuestions]
454+
: generalQuestions;
459455

460456
return newChatPlaceholders[
461457
Math.floor(Math.random() * newChatPlaceholders.length)
@@ -592,10 +588,10 @@ export const AiRequestChat = React.forwardRef<Props, AiRequestChatInterface>(
592588
setHasStartedRequestButCannotContinue(cannotContinue);
593589
if (cannotContinue) return;
594590

595-
if (hasOpenedProject) {
591+
if (hasOpenedProject && standAloneForm) {
596592
const response = await showConfirmation({
597-
title: t`Close your project?`,
598-
message: t`This action will close your current project. All your changes will be lost.`,
593+
title: t`Start a new game?`,
594+
message: t`This will close your current project. Unsaved changes will be lost.`,
599595
confirmButtonLabel: t`Continue`,
600596
});
601597

@@ -619,6 +615,7 @@ export const AiRequestChat = React.forwardRef<Props, AiRequestChatInterface>(
619615
hasOpenedProject,
620616
showConfirmation,
621617
selectedMode,
618+
standAloneForm,
622619
]
623620
);
624621

@@ -832,7 +829,7 @@ export const AiRequestChat = React.forwardRef<Props, AiRequestChatInterface>(
832829
justifyContent="space-between"
833830
>
834831
<Column noMargin>
835-
{!standAloneForm && !project && (
832+
{!standAloneForm && (
836833
<CompactSelectField
837834
disabled={isWorking}
838835
value={selectedMode}

0 commit comments

Comments
 (0)