Skip to content

Commit

Permalink
Merge pull request #251 from multiversx/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
radumojic authored Oct 3, 2024
2 parents 15c7a8b + 5109d83 commit 8580d78
Show file tree
Hide file tree
Showing 13 changed files with 439 additions and 422 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/deploy-devnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
ref: main
- name: Use Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: '18.x'
- name: Setup yarn
Expand All @@ -26,7 +26,7 @@ jobs:
env:
CI: false
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/deploy-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
ref: development
- name: Use Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: '18.x'
- name: Setup yarn
Expand All @@ -26,7 +26,7 @@ jobs:
env:
CI: false
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/deploy-mainnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
ref: main
- name: Use Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: '18.x'
- name: Setup yarn
Expand All @@ -26,7 +26,7 @@ jobs:
env:
CI: false
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/deploy-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
ref: main
- name: Use Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: '16.x'
- name: Setup yarn
Expand All @@ -23,7 +23,7 @@ jobs:
env:
CI: false
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/deploy-testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
ref: main
- name: Use Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: '18.x'
- name: Setup yarn
Expand All @@ -26,7 +26,7 @@ jobs:
env:
CI: false
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/night-e2e-workern.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
needs: Slack-Notification
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Run install
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pre-merge-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
needs: Slack-Notification
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Run install
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"@fortawesome/fontawesome-svg-core": "6.5.1",
"@fortawesome/free-solid-svg-icons": "6.5.1",
"@fortawesome/react-fontawesome": "0.2.0",
"@multiversx/sdk-core": "13.2.1",
"@multiversx/sdk-dapp": "2.40.6",
"@multiversx/sdk-network-providers": "2.4.3",
"axios": "1.6.5",
"@multiversx/sdk-core": "13.7.0",
"@multiversx/sdk-dapp": "2.40.9",
"@multiversx/sdk-network-providers": "2.8.0",
"axios": "1.7.4",
"classnames": "2.3.2",
"moment": "2.29.4",
"react": "18.2.0",
Expand Down
2 changes: 1 addition & 1 deletion src/config/config.testnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { EnvironmentsEnum } from 'types';
export * from './sharedConfig';

export const contractAddress =
'erd1qqqqqqqqqqqqqpgqfu2wwk9vjd6rnvu38vyushh67dtdkuvy9l5q3wkk6r';
'erd1qqqqqqqqqqqqqpgq8tq5rulzxzje29v8kzmcxx9pgx6kmevmep6qckwthl';
export const API_URL = 'https://testnet-template-api.multiversx.com';
export const sampleAuthenticatedDomains = [API_URL];
export const environment = EnvironmentsEnum.testnet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const BatchTransactions = ({ callbackRoute }: WidgetProps) => {
SignedTransactionType[] | null
>(null);
const [currentSessionId, setCurrentSessionId] = useState(
sessionStorage.getItem(SessionEnum.signedSessionId)
sessionStorage.getItem(SessionEnum.signedSessionId) || ''
);

const { batchId, setBatchSessionId } = useSendSignedTransactions({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import {
import { useBatchTransactionContext } from 'wrappers';

export const useSendSignedTransactions = ({
signedSessionId = null
signedSessionId = ''
}: {
signedSessionId: string | null;
signedSessionId: string;
}) => {
const [batchSessionId, setBatchSessionId] = useState<string | null>(
sessionStorage.getItem(SessionEnum.batchSessionId)
Expand Down Expand Up @@ -85,6 +85,8 @@ export const useSendSignedTransactions = ({
}
};

const status = signedTransactions[signedSessionId]?.status;

useEffect(() => {
if (!sendBatchTransactionsOnDemand) {
return;
Expand All @@ -94,13 +96,10 @@ export const useSendSignedTransactions = ({
return;
}

if (
signedTransactions[signedSessionId]?.status ===
TransactionBatchStatusesEnum.signed
) {
if (status === TransactionBatchStatusesEnum.signed) {
sendTransactions();
}
}, [batchSessionId, signedTransactions[signedSessionId]?.status]);
}, [batchSessionId, status]);

return {
batchId,
Expand Down
23 changes: 14 additions & 9 deletions src/wrappers/AuthRedirectWrapper/AuthRedirectWrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { PropsWithChildren } from 'react';
import { Navigate } from 'react-router-dom';
import { useGetIsLoggedIn } from 'hooks';
import { PropsWithChildren, useEffect } from 'react';
import { useNavigate } from 'react-router-dom';
import { RouteNamesEnum } from 'localConstants';
import { useGetIsLoggedIn } from '../../hooks';

interface AuthRedirectWrapperPropsType extends PropsWithChildren {
requireAuth?: boolean;
Expand All @@ -12,14 +12,19 @@ export const AuthRedirectWrapper = ({
requireAuth = true
}: AuthRedirectWrapperPropsType) => {
const isLoggedIn = useGetIsLoggedIn();
const navigate = useNavigate();

if (isLoggedIn && !requireAuth) {
return <Navigate to={RouteNamesEnum.dashboard} />;
}
useEffect(() => {
if (isLoggedIn && !requireAuth) {
navigate(RouteNamesEnum.dashboard);

if (!isLoggedIn && requireAuth) {
return <Navigate to={RouteNamesEnum.unlock} />;
}
return;
}

if (!isLoggedIn && requireAuth) {
navigate(RouteNamesEnum.unlock);
}
}, [isLoggedIn]);

return <>{children}</>;
};
Loading

0 comments on commit 8580d78

Please sign in to comment.