Skip to content

Commit b3d8887

Browse files
committed
Refactor AgentAIPromptSection to improve button state management and update styles. Removed unnecessary isDirty check and adjusted childrenStyles for better layout consistency.
1 parent 15693a7 commit b3d8887

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/pages/settings/Profile/AgentAIPromptSection.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ function AgentAIPromptSection({accountID, parentScrollViewRef}: AgentAIPromptSec
7070
errorText = translate('common.error.invalidCharacter');
7171
}
7272
const storedPrompt = Str.htmlDecode(agentPrompt?.prompt ?? '');
73-
const isDirty = draftPrompt !== storedPrompt;
7473

7574
// Delegate.connect seeds IS_LOADING_APP=true via clearOnyxForDelegateTransition and OpenApp's optimisticData,
7675
// then flips it back to false in OpenApp's finallyData. By that point NetworkStore.authToken is the delegate.
@@ -170,7 +169,7 @@ function AgentAIPromptSection({accountID, parentScrollViewRef}: AgentAIPromptSec
170169
subtitle={translate('profilePage.aiPromptSection.subtitle')}
171170
isCentralPane
172171
subtitleMuted
173-
childrenStyles={styles.pt3}
172+
childrenStyles={styles.pt5}
174173
titleStyles={styles.accountSettingsSectionTitle}
175174
>
176175
<OfflineWithFeedback
@@ -200,7 +199,7 @@ function AgentAIPromptSection({accountID, parentScrollViewRef}: AgentAIPromptSec
200199
icon={showSavedConfirmation ? icons.Checkmark : undefined}
201200
onPress={handleSave}
202201
isLoading={isSaving}
203-
isDisabled={!isDirty || hasHtmlTag || isSaving}
202+
isDisabled={hasHtmlTag || isSaving}
204203
style={[styles.alignSelfStart]}
205204
testID="save-prompt-button"
206205
/>

0 commit comments

Comments
 (0)