From 39d4aaddd2665befdfd7099a30e843193c87e8f4 Mon Sep 17 00:00:00 2001 From: James Young <18669334+noroadsleft@users.noreply.github.com> Date: Mon, 1 Apr 2024 15:32:17 -0700 Subject: [PATCH] Update filenames of JSON keymap exports (#1335) Updates the filenames of JSON keymap exports to include the name of the keyboard if the keymap name is given, instead of only the keymap name. --- src/store/modules/app/getters.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/store/modules/app/getters.js b/src/store/modules/app/getters.js index b829fcb46c..fd0371663c 100644 --- a/src/store/modules/app/getters.js +++ b/src/store/modules/app/getters.js @@ -10,9 +10,11 @@ const getters = { filter: (state) => state.filter, exportKeymapName: (state) => { let exportName = state.keymapName.replace(/[\s/]/g, '_').toLowerCase(); + let keyboardName = state.keyboard.replace(/[\s/]/g, '_').toLowerCase(); if (exportName === '') { - let keyboardName = state.keyboard.replace(/[\s/]/g, '_').toLowerCase(); exportName = `${keyboardName}_${state.layout}_mine`.toLowerCase(); + } else { + exportName = `${keyboardName}_${exportName}`.toLowerCase(); } // issue #331 whitelist what we send to API for keymapName and save to disk exportName = exportName.replace(/[^a-z0-9_-]/gi, '');