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

Commit

Permalink
Merge pull request #37 from oxygenpay/develop
Browse files Browse the repository at this point in the history
fix(merchants): fix merchant screen
  • Loading branch information
swift1337 authored Sep 27, 2023
2 parents ad0c9d9 + 7312329 commit 272c5ed
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 15 deletions.
3 changes: 1 addition & 2 deletions ui-dashboard/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
<link rel="icon" type="image/png" sizes="32x32" href="/fav/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="/fav/favicon-16x16.png" />
<link rel="manifest" href="/fav/site.webmanifest" />
<link rel="mask-icon" href="/fav/safari-pinned-tab.svg" color="#5bbad5" />
<meta name="msapplication-TileColor" content="#333333" />
<link rel="mask-icon" href="/fav/safari-pinned-tab.svg" color="#50AF95" />
<meta name="theme-color" content="#333333" />
<title>O2Pay</title>
</head>
Expand Down
10 changes: 3 additions & 7 deletions ui-dashboard/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,20 +156,16 @@ const App: React.FC = () => {
};

const listMerchant = async () => {
if (!user) {
return;
if (user && newMerchantId) {
await getMerchant(newMerchantId);
}

if (!newMerchantId) return;

await getMerchant(newMerchantId);
setIsLoading(false);
};

await getCookie();
await getMe();
await listMerchants();
await listMerchant();
setIsLoading(false);
};

useMount(async () => {
Expand Down
2 changes: 2 additions & 0 deletions ui-dashboard/src/hooks/use-merchant-id.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ const useMerchantId = (): MerchantIdState => {
setMerchantId(merchantId);
if (merchantId) {
localStorage.set("merchantId", merchantId);
} else {
localStorage.remove("merchantId");
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,7 @@ const ManageMerchantsPage: React.FC = () => {
await getMerchants();

const nextMerchant = merchants?.find((merchantItem) => merchantItem.id !== merchant.id);

if (nextMerchant) {
setMerchantId(nextMerchant.id);
}
setMerchantId(nextMerchant ? nextMerchant.id : null);

openNotification(`Merchant ${merchant.name} has been deleted`, "Thank you for being with us");
} catch (error) {
Expand Down
3 changes: 1 addition & 2 deletions ui-payment/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
<link rel="icon" type="image/png" sizes="32x32" href="/fav/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="/fav/favicon-16x16.png" />
<link rel="manifest" href="/fav/site.webmanifest" />
<link rel="mask-icon" href="/fav/safari-pinned-tab.svg" color="#4faf95" />
<meta name="msapplication-TileColor" content="#4faf95" />
<link rel="mask-icon" href="/fav/safari-pinned-tab.svg" color="#50AF95" />
<meta name="theme-color" content="#4faf95" />
<title>OxygenPay</title>
</head>
Expand Down

0 comments on commit 272c5ed

Please sign in to comment.