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 77 < link rel ="icon " type ="image/png " sizes ="32x32 " href ="/fav/favicon-32x32.png " />
88 < link rel ="icon " type ="image/png " sizes ="16x16 " href ="/fav/favicon-16x16.png " />
99 < 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 " />
1211 < meta name ="theme-color " content ="#333333 " />
1312 < title > O2Pay</ title >
1413 </ head >
Original file line number Diff line number Diff line change @@ -156,20 +156,16 @@ const App: React.FC = () => {
156156 } ;
157157
158158 const listMerchant = async ( ) => {
159- if ( ! user ) {
160- return ;
159+ if ( user && newMerchantId ) {
160+ await getMerchant ( newMerchantId ) ;
161161 }
162-
163- if ( ! newMerchantId ) return ;
164-
165- await getMerchant ( newMerchantId ) ;
166- setIsLoading ( false ) ;
167162 } ;
168163
169164 await getCookie ( ) ;
170165 await getMe ( ) ;
171166 await listMerchants ( ) ;
172167 await listMerchant ( ) ;
168+ setIsLoading ( false ) ;
173169 } ;
174170
175171 useMount ( async ( ) => {
Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ const useMerchantId = (): MerchantIdState => {
1414 setMerchantId ( merchantId ) ;
1515 if ( merchantId ) {
1616 localStorage . set ( "merchantId" , merchantId ) ;
17+ } else {
18+ localStorage . remove ( "merchantId" ) ;
1719 }
1820 } ;
1921
Original file line number Diff line number Diff line change @@ -85,10 +85,7 @@ const ManageMerchantsPage: React.FC = () => {
8585 await getMerchants ( ) ;
8686
8787 const nextMerchant = merchants ?. find ( ( merchantItem ) => merchantItem . id !== merchant . id ) ;
88-
89- if ( nextMerchant ) {
90- setMerchantId ( nextMerchant . id ) ;
91- }
88+ setMerchantId ( nextMerchant ? nextMerchant . id : null ) ;
9289
9390 openNotification ( `Merchant ${ merchant . name } has been deleted` , "Thank you for being with us" ) ;
9491 } catch ( error ) {
Original file line number Diff line number Diff line change 77 < link rel ="icon " type ="image/png " sizes ="32x32 " href ="/fav/favicon-32x32.png " />
88 < link rel ="icon " type ="image/png " sizes ="16x16 " href ="/fav/favicon-16x16.png " />
99 < 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 " />
1211 < meta name ="theme-color " content ="#4faf95 " />
1312 < title > OxygenPay</ title >
1413 </ head >
You can’t perform that action at this time.
0 commit comments