Skip to content

Commit

Permalink
Save "repeat" as string
Browse files Browse the repository at this point in the history
When loading the config from file, repeat is loaded as a string.
However, when updating it directly on the model it is stored as a bool.

Store it as a string for consistency.

Fixes #94
  • Loading branch information
JoseExposito committed Oct 8, 2023
1 parent d424613 commit 1545f41
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ class RunCommandRowSettings extends Gtk.Grid {
getSettings() {
const actionSettings = {
command: this.commandEntry.text,
repeat: this.repeatSwitch.get_active(),
repeat: JSON.stringify(this.repeatSwitch.get_active()),
animation: this.animationCombo.getAnimationType(),
};

if (actionSettings.repeat) {
if (this.repeatSwitch.get_active()) {
actionSettings.decreaseCommand = this.oppositeCommandEntry.text;
} else {
actionSettings.on = this.onBeginEndCombo.active_id;
Expand Down
4 changes: 2 additions & 2 deletions src/main-view/content/row-settings/send-keys-row-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,11 @@ class SendKeysRowSettings extends Gtk.Grid {
const actionSettings = {
modifiers: SendKeysRowSettings.arrayToKeySettings(this.shortcutButton.getModifiers()),
keys: SendKeysRowSettings.arrayToKeySettings(this.shortcutButton.getKeys()),
repeat: this.repeatSwitch.get_active(),
repeat: JSON.stringify(this.repeatSwitch.get_active()),
animation: this.animationCombo.getAnimationType(),
};

if (actionSettings.repeat) {
if (this.repeatSwitch.get_active()) {
actionSettings.decreaseKeys = SendKeysRowSettings.arrayToKeySettings([
...this.oppositeShortcutButton.getModifiers(),
...this.oppositeShortcutButton.getKeys(),
Expand Down

0 comments on commit 1545f41

Please sign in to comment.