Skip to content

Commit 05a275b

Browse files
committed
only show option to save settings if canSave={true}
1 parent dbbcb51 commit 05a275b

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

‎src/components/gui/gui.jsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ const GUIComponent = props => {
187187
<TWSecurityManager securityManager={securityManager} />
188188
<TWRestorePointManager />
189189
{/*usernameModalVisible && <TWUsernameModal />*/}
190-
{settingsModalVisible && <TWSettingsModal />}
190+
{settingsModalVisible && <TWSettingsModal canSave={canSave}/>}
191191
{customExtensionModalVisible && <TWCustomExtensionModal />}
192192
{fontsModalVisible && <TWFontsModal />}
193193
{unknownPlatformModalVisible && <TWUnknownPlatformModal />}

‎src/components/tw-settings-modal/settings-modal.jsx‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -411,9 +411,9 @@ const StoreProjectOptions = ({onStoreProjectOptions}) => (
411411
<p>
412412
<FormattedMessage
413413
// eslint-disable-next-line max-len
414-
defaultMessage="Stores the selected settings in the project so they will be automatically applied when TurboWarp loads this project. Warp timer and disable compiler will not be saved."
414+
defaultMessage="Stores the selected settings in the project so they will be automatically applied when anyone loads this project. Warp timer and disable compiler will not be saved."
415415
description="Help text for the store settings in project button"
416-
id="tw.settingsModal.storeProjectOptionsHelp"
416+
id="tw.settingsModal.storeProjectOptionsHelp.ct"
417417
/>
418418
</p>
419419
</div>
@@ -500,11 +500,11 @@ const SettingsModalComponent = props => (
500500
value={props.disableCompiler}
501501
onChange={props.onDisableCompilerChange}
502502
/>
503-
{!props.isEmbedded && (
503+
{!props.isEmbedded && props.canSave && (
504504
<StoreProjectOptions
505505
{...props}
506506
/>
507-
)}
507+
)}
508508
</Box>
509509
</Modal>
510510
);
@@ -529,7 +529,8 @@ SettingsModalComponent.propTypes = {
529529
warpTimer: PropTypes.bool,
530530
onWarpTimerChange: PropTypes.func,
531531
disableCompiler: PropTypes.bool,
532-
onDisableCompilerChange: PropTypes.func
532+
onDisableCompilerChange: PropTypes.func,
533+
canSave: PropTypes.bool,
533534
};
534535

535536
export default injectIntl(SettingsModalComponent);

0 commit comments

Comments
 (0)