Skip to content

Commit

Permalink
Settings: fix Square POS migration
Browse files Browse the repository at this point in the history
  • Loading branch information
kaloudis committed Jan 4, 2024
1 parent 1082997 commit 14f0742
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions stores/SettingsStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ export default class SettingsStore {
},
pos: {
posEnabled: PosEnabled.Disabled,
squareEnabled: false,
squareEnabled: false, // deprecated
squareAccessToken: '',
squareLocationId: '',
merchantName: '',
Expand Down Expand Up @@ -1050,12 +1050,9 @@ export default class SettingsStore {
}

// migrate old POS squareEnabled setting to posEnabled
if (!this.settings.pos.posEnabled) {
if (this.settings.pos.squareEnabled) {
this.settings.pos.posEnabled = PosEnabled.Square;
} else {
this.settings.pos.posEnabled = PosEnabled.Disabled;
}
if (this.settings?.pos?.squareEnabled) {
this.settings.pos.posEnabled = PosEnabled.Square;
this.settings.pos.squareEnabled = false;
}

const node: any =
Expand Down

0 comments on commit 14f0742

Please sign in to comment.