Skip to content

Commit

Permalink
Merge branch 'master' into fixes-2
Browse files Browse the repository at this point in the history
  • Loading branch information
zielvna committed Oct 3, 2024
2 parents 03a60b0 + ca7eb32 commit 245c200
Show file tree
Hide file tree
Showing 7 changed files with 101 additions and 41 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/deploy-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: deploy master

on:
push:
branches: [master]

jobs:
upload:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Deploy to Vercel Action
uses: BetaHuhn/deploy-to-vercel-action@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_SCOPE: ${{ secrets.VERCEL_ORG_ID }}
ALIAS_DOMAINS: |
alph.invariant.app
35 changes: 35 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: preview

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
- name: install
run: npm i
- name: build
run: npm run build

upload:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Deploy to Vercel Action
uses: BetaHuhn/deploy-to-vercel-action@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_SCOPE: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
PRODUCTION: false
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@alephium/web3": "^1.7.3",
"@alephium/web3-react": "^1.7.3",
"@emotion/styled": "^11.13.0",
"@invariant-labs/alph-sdk": "^0.0.12",
"@invariant-labs/alph-sdk": "^0.0.13",
"@mui/icons-material": "^6.1.1",
"@mui/material": "^6.1.1",
"@nivo/bar": "^0.87.0",
Expand Down
1 change: 1 addition & 0 deletions src/components/PositionsList/PositionItem/style.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const useStyles = makeStyles()((theme: Theme) => ({

[theme.breakpoints.down("sm")]: {
width: 28,
height: 28,
},
},
arrows: {
Expand Down
6 changes: 4 additions & 2 deletions src/containers/HeaderWrapper/HeaderWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@ export const HeaderWrapper: React.FC = () => {
})
);
}
}, [account, signer]);

if (!account && !signer) {
useEffect(() => {
if (!account && !signer && walletStatus === Status.Initialized) {
dispatch(walletActions.disconnect());
}
}, [account, signer]);
}, [account, signer, walletStatus]);

const defaultTestnetRPC = useMemo(() => {
const lastRPC = localStorage.getItem(
Expand Down
68 changes: 34 additions & 34 deletions src/store/sagas/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export function* handleAirdrop(): Generator {
}

const loaderAirdrop = createLoaderKey();
let loaderSigningTx = createLoaderKey();
const loaderSigningTx = createLoaderKey();

try {
yield put(
Expand All @@ -74,45 +74,45 @@ export function* handleAirdrop(): Generator {

const faucetTokenList = getFaucetTokenList(network);

for (const ticker in faucetTokenList) {
const address = faucetTokenList[ticker as keyof typeof faucetTokenList];
const airdropAmount =
TokenAirdropAmount[ticker as keyof typeof faucetTokenList];
yield put(
snackbarsActions.add({
message: "Signing transaction...",
variant: "pending",
persist: true,
key: loaderSigningTx,
})
);

loaderSigningTx = createLoaderKey();
yield put(
snackbarsActions.add({
message: "Signing transaction...",
variant: "pending",
persist: true,
key: loaderSigningTx,
})
);
const airdropTxId = yield* call(
[fungibleToken, fungibleToken.airdrop],
walletSigner,
TokenAirdropAmount.BTC as TokenAmount,
faucetTokenList.BTC,
TokenAirdropAmount.ETH as TokenAmount,
faucetTokenList.ETH,
TokenAirdropAmount.USDC as TokenAmount,
faucetTokenList.USDC,
address
);

const txId = yield* call(
[fungibleToken, fungibleToken.mint],
walletSigner,
airdropAmount as TokenAmount,
address
);
closeSnackbar(loaderSigningTx);
yield put(snackbarsActions.remove(loaderSigningTx));

yield* call(fetchBalances, [address]);
closeSnackbar(loaderAirdrop);
yield put(snackbarsActions.remove(loaderAirdrop));

closeSnackbar(loaderSigningTx);
yield put(snackbarsActions.remove(loaderSigningTx));
const tokenNames = Object.keys(faucetTokenList).join(", ");

yield* put(
snackbarsActions.add({
message: `Airdropped ${ticker} token`,
variant: "success",
persist: false,
txid: txId,
})
);
}
yield* put(
snackbarsActions.add({
message: `Airdropped ${tokenNames} tokens`,
variant: "success",
persist: false,
txid: airdropTxId,
})
);

closeSnackbar(loaderAirdrop);
yield put(snackbarsActions.remove(loaderAirdrop));
yield* call(fetchBalances, [...Object.values(faucetTokenList)]);
} catch (error) {
console.log(error);

Expand Down

0 comments on commit 245c200

Please sign in to comment.