This repository was archived by the owner on Jul 1, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +8
-15
lines changed
pages/manage-merchants-page Expand file tree Collapse file tree 5 files changed +8
-15
lines changed Original file line number Diff line number Diff line change 7
7
< link rel ="icon " type ="image/png " sizes ="32x32 " href ="/fav/favicon-32x32.png " />
8
8
< link rel ="icon " type ="image/png " sizes ="16x16 " href ="/fav/favicon-16x16.png " />
9
9
< link rel ="manifest " href ="/fav/site.webmanifest " />
10
- < link rel ="mask-icon " href ="/fav/safari-pinned-tab.svg " color ="#5bbad5 " />
11
- < meta name ="msapplication-TileColor " content ="#333333 " />
10
+ < link rel ="mask-icon " href ="/fav/safari-pinned-tab.svg " color ="#50AF95 " />
12
11
< meta name ="theme-color " content ="#333333 " />
13
12
< title > O2Pay</ title >
14
13
</ head >
Original file line number Diff line number Diff line change @@ -156,20 +156,16 @@ const App: React.FC = () => {
156
156
} ;
157
157
158
158
const listMerchant = async ( ) => {
159
- if ( ! user ) {
160
- return ;
159
+ if ( user && newMerchantId ) {
160
+ await getMerchant ( newMerchantId ) ;
161
161
}
162
-
163
- if ( ! newMerchantId ) return ;
164
-
165
- await getMerchant ( newMerchantId ) ;
166
- setIsLoading ( false ) ;
167
162
} ;
168
163
169
164
await getCookie ( ) ;
170
165
await getMe ( ) ;
171
166
await listMerchants ( ) ;
172
167
await listMerchant ( ) ;
168
+ setIsLoading ( false ) ;
173
169
} ;
174
170
175
171
useMount ( async ( ) => {
Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ const useMerchantId = (): MerchantIdState => {
14
14
setMerchantId ( merchantId ) ;
15
15
if ( merchantId ) {
16
16
localStorage . set ( "merchantId" , merchantId ) ;
17
+ } else {
18
+ localStorage . remove ( "merchantId" ) ;
17
19
}
18
20
} ;
19
21
Original file line number Diff line number Diff line change @@ -85,10 +85,7 @@ const ManageMerchantsPage: React.FC = () => {
85
85
await getMerchants ( ) ;
86
86
87
87
const nextMerchant = merchants ?. find ( ( merchantItem ) => merchantItem . id !== merchant . id ) ;
88
-
89
- if ( nextMerchant ) {
90
- setMerchantId ( nextMerchant . id ) ;
91
- }
88
+ setMerchantId ( nextMerchant ? nextMerchant . id : null ) ;
92
89
93
90
openNotification ( `Merchant ${ merchant . name } has been deleted` , "Thank you for being with us" ) ;
94
91
} catch ( error ) {
Original file line number Diff line number Diff line change 7
7
< link rel ="icon " type ="image/png " sizes ="32x32 " href ="/fav/favicon-32x32.png " />
8
8
< link rel ="icon " type ="image/png " sizes ="16x16 " href ="/fav/favicon-16x16.png " />
9
9
< link rel ="manifest " href ="/fav/site.webmanifest " />
10
- < link rel ="mask-icon " href ="/fav/safari-pinned-tab.svg " color ="#4faf95 " />
11
- < meta name ="msapplication-TileColor " content ="#4faf95 " />
10
+ < link rel ="mask-icon " href ="/fav/safari-pinned-tab.svg " color ="#50AF95 " />
12
11
< meta name ="theme-color " content ="#4faf95 " />
13
12
< title > OxygenPay</ title >
14
13
</ head >
You can’t perform that action at this time.
0 commit comments