Skip to content
This repository was archived by the owner on Jul 1, 2024. It is now read-only.

Commit 272c5ed

Browse files
authored
Merge pull request #37 from oxygenpay/develop
fix(merchants): fix merchant screen
2 parents ad0c9d9 + 7312329 commit 272c5ed

File tree

5 files changed

+8
-15
lines changed

5 files changed

+8
-15
lines changed

ui-dashboard/index.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
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>

ui-dashboard/src/app.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff 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 () => {

ui-dashboard/src/hooks/use-merchant-id.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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

ui-dashboard/src/pages/manage-merchants-page/manage-merchants-page.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff 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) {

ui-payment/index.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
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>

0 commit comments

Comments
 (0)