@@ -221,7 +221,7 @@ function hide(): void {
221221async function apply ( ) : Promise < void > {
222222 const modalEl = modal . getModal ( ) ;
223223 const action = modalEl . getAttribute ( "data-action" ) ;
224- const presetName = modalEl
224+ const propPresetName = modalEl
225225 . qsr < HTMLInputElement > ( ".group input[title='presets']" )
226226 . getValue ( ) as string ;
227227 const presetId = modalEl . getAttribute ( "data-preset-id" ) as string ;
@@ -252,7 +252,7 @@ async function apply(): Promise<void> {
252252 //validate the preset name only in add or edit mode
253253
254254 const noPresetName : boolean =
255- presetName . replace ( / ^ _ + | _ + $ / g, "" ) . length === 0 ; //all whitespace names are rejected
255+ propPresetName . replace ( / ^ _ + | _ + $ / g, "" ) . length === 0 ; //all whitespace names are rejected
256256 if ( noPresetName ) {
257257 showNoticeNotification ( "Preset name cannot be empty" ) ;
258258 return ;
@@ -271,10 +271,10 @@ async function apply(): Promise<void> {
271271 if ( action === "add" ) {
272272 const configChanges = getConfigChanges ( ) ;
273273 const activeSettingGroups = getActiveSettingGroupsFromState ( ) ;
274- const cleanedName = PresetNameSchema . parse ( presetName ) ;
274+ const presetName = PresetNameSchema . parse ( propPresetName ) ;
275275 const response = await Ape . presets . add ( {
276276 body : {
277- name : cleanedName ,
277+ name : presetName ,
278278 config : configChanges ,
279279 ...( state . presetType === "partial" && {
280280 settingGroups : activeSettingGroups ,
@@ -287,12 +287,12 @@ async function apply(): Promise<void> {
287287 } else {
288288 showSuccessNotification ( "Preset added" , { durationMs : 2000 } ) ;
289289 snapshotPresets . push ( {
290- name : cleanedName ,
290+ name : presetName ,
291291 config : configChanges ,
292292 ...( state . presetType === "partial" && {
293293 settingGroups : activeSettingGroups ,
294294 } ) ,
295- display : cleanedName . replace ( / _ / g, " " ) ,
295+ display : presetName . replace ( / _ / g, " " ) ,
296296 _id : response . body . data . presetId ,
297297 } as SnapshotPreset ) ;
298298 }
@@ -307,11 +307,11 @@ async function apply(): Promise<void> {
307307 const configChanges = getConfigChanges ( ) ;
308308 const activeSettingGroups : ConfigGroupName [ ] | null =
309309 state . presetType === "partial" ? getActiveSettingGroupsFromState ( ) : null ;
310- const cleanedName = PresetNameSchema . parse ( presetName ) ;
310+ const presetName = PresetNameSchema . parse ( propPresetName ) ;
311311 const response = await Ape . presets . save ( {
312312 body : {
313313 _id : presetId ,
314- name : cleanedName ,
314+ name : presetName ,
315315 ...( updateConfig && {
316316 config : configChanges ,
317317 settingGroups : activeSettingGroups ,
@@ -324,8 +324,8 @@ async function apply(): Promise<void> {
324324 } else {
325325 showSuccessNotification ( "Preset updated" ) ;
326326
327- preset . name = cleanedName ;
328- preset . display = cleanedName . replace ( / _ / g, " " ) ;
327+ preset . name = presetName ;
328+ preset . display = presetName . replace ( / _ / g, " " ) ;
329329 if ( updateConfig ) {
330330 preset . config = configChanges ;
331331 if ( state . presetType === "partial" ) {
0 commit comments