Skip to content

Commit

Permalink
Set POS default view on wallet
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhamkmr04 committed Sep 10, 2024
1 parent 5dc1af3 commit f0e9d7d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,7 @@
"views.Settings.POS.Category.noCategoriesDefined": "No categories defined yet",
"views.Settings.POS.saveCategory": "Save category",
"views.Settings.POS.Products": "Products",
"views.Settings.POS.Keypad": "POS Keypad",
"views.Settings.POS.Product": "Product",
"views.Settings.POS.Product.name": "Product name",
"views.Settings.POS.Product.noProductsDefined": "No products defined yet",
Expand Down
6 changes: 3 additions & 3 deletions stores/SettingsStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -941,9 +941,9 @@ export const DEFAULT_VIEW_KEYS_POS = [
value: 'Products'
},
{
key: 'Keypad',
translateKey: 'views.Settings.Display.DefaultView.keypad',
value: 'Keypad'
key: 'POS Keypad',
translateKey: 'views.Settings.POS.Keypad',
value: 'POS Keypad'
}
];

Expand Down
6 changes: 4 additions & 2 deletions views/Wallet/Wallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,9 @@ export default class Wallet extends React.Component<WalletProps, WalletState> {
initialRouteName={
posEnabled !== PosEnabled.Disabled &&
posStatus === 'active'
? 'POS'
? (settings.pos &&
settings.pos.defaultView) ||
'Products'
: isSyncing
? 'Balance'
: (settings.display &&
Expand All @@ -720,7 +722,7 @@ export default class Wallet extends React.Component<WalletProps, WalletState> {
if (route.name === 'Balance') {
return <Temple fill={color} />;
}
if (route.name === 'POS') {
if (route.name === 'Products') {
return <POS stroke={color} />;
}
if (route.name === 'POS Keypad') {
Expand Down

0 comments on commit f0e9d7d

Please sign in to comment.