Skip to content

Commit

Permalink
fix: temporary use snap version 0.1.1 for the site
Browse files Browse the repository at this point in the history
  • Loading branch information
SotaTek-TungNguyen2 committed Dec 11, 2023
1 parent 380dc2d commit 7e51f45
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/site/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ REACT_APP_SNAP_ID=npm:mina-portal
REACT_APP_SNAP_VERSION=*
REACT_APP_MIN_SNAP_VERSION=1.2.0
REACT_APP_ZK_ADDRESS=B62qnnzR3T62Du9ad2ug8HzuSbG8G1y61qmXVFx3ZSDNyP6rLRbWz46
NEED_UPDATE=false

# environment: develop | staging | production
NODE_ENV=develop
Expand Down
7 changes: 5 additions & 2 deletions packages/site/src/services/useMinaSnap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,13 @@ export const useMinaSnap = () => {

const connectToSnap = async () => {
const latestSnapVersion = await getLatestSnapVersion();
const version = (snapVersion != latestSnapVersion) ? latestSnapVersion : snapVersion;
let version = snapVersion;
if (process.env.REACT_APP_NEED_UPDATE && (snapVersion != latestSnapVersion)) {
version = latestSnapVersion;
}
return await ethereum.request({
method: 'wallet_requestSnaps',
params: { [snapId]: { version: `^${version}` } } })
params: { [snapId]: { version: `${version}` } } })
};

const getSnap = async () => {
Expand Down

0 comments on commit 7e51f45

Please sign in to comment.