Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development #251

Merged
merged 10 commits into from
Oct 3, 2024
Merged
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
Loading