Skip to content

Commit 6a4fcfb

Browse files
committed
set custom only for preset properties
1 parent edeb72d commit 6a4fcfb

File tree

1 file changed

+10
-1
lines changed
  • packages/app/src/app/pages/common/Modals/ShareModal2

1 file changed

+10
-1
lines changed

packages/app/src/app/pages/common/Modals/ShareModal2/index.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,16 @@ function ShareModal() {
112112
});
113113

114114
const change = property => {
115-
setSettings({ ...settings, preset: 'custom', ...property });
115+
setSettings(currentSettings => {
116+
// set new property in settings
117+
const newSettings = { ...currentSettings, ...property };
118+
119+
// if the property is part of a preset options (not global options),
120+
// then change preset to custom
121+
if (!(property in globalOptions)) newSettings.preset = 'custom';
122+
123+
return newSettings;
124+
});
116125
};
117126

118127
const toggle = property => {

0 commit comments

Comments
 (0)