Skip to content

Commit

Permalink
Preserve macros defined in keyboard JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
cortex committed Nov 20, 2024
1 parent cf968a0 commit e535bff
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/components/ControllerBottom.vue
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ export default {
'firmwareSourceURL',
'keymapSourceURL',
'author',
'macros',
'notes',
'electron'
]),
Expand Down Expand Up @@ -209,6 +210,7 @@ export default {
'setKeymapName',
'setLayout',
'setNotes',
'setMacros',
'startListening',
'stopListening'
]),
Expand Down Expand Up @@ -258,6 +260,7 @@ export default {
const { keymap } = this.templates;
let data = Object.assign(keymap, {
keyboard: this.keyboard,
macros: this.macros,
keymap: this.exportKeymapName,
layout: this.layout,
layers: layers,
Expand Down Expand Up @@ -367,6 +370,10 @@ export default {
this.setNotes(notes);
}
if (!isUndefined(data.macros)) {
this.setMacros(data.macros);
}
// remap old json files to new mappings if they need it
data = Object.assign(
data,
Expand Down
3 changes: 3 additions & 0 deletions src/store/modules/app/mutations.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ const mutations = {
setNotes(state, newNotes) {
state.notes = newNotes;
},
setMacros(state, newMacros) {
state.macros = newMacros;
},
toggleTutorial(state) {
state.tutorialEnabled = !state.tutorialEnabled;
},
Expand Down

0 comments on commit e535bff

Please sign in to comment.