Skip to content

Commit

Permalink
Merge pull request #268 from secretkeylabs/release/v0.35.1
Browse files Browse the repository at this point in the history
release: v0.35.1 to main
  • Loading branch information
fedeerbes committed May 16, 2024
2 parents 781f6b8 + 95848f2 commit 8785114
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 20 deletions.
18 changes: 9 additions & 9 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "xverse-web-extension",
"description": "A Bitcoin wallet for Web3",
"version": "0.35.0",
"version": "0.35.1",
"private": true,
"engines": {
"node": "^18.18.2"
Expand All @@ -25,7 +25,7 @@
"@playwright/test": "^1.43.1",
"@react-spring/web": "^9.6.1",
"@scure/btc-signer": "1.2.1",
"@secretkeylabs/xverse-core": "13.6.5",
"@secretkeylabs/xverse-core": "13.6.7",
"@stacks/connect": "7.4.1",
"@stacks/stacks-blockchain-api-types": "6.1.1",
"@stacks/transactions": "6.13.1",
Expand Down
19 changes: 12 additions & 7 deletions src/app/hooks/useSanityCheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,29 @@ import useWalletSelector from './useWalletSelector';
declare const VERSION: string;

const useSanityCheck = () => {
const { selectedAccount, network } = useWalletSelector();
const { network, accountsList } = useWalletSelector();
const { getSeed } = useSeedVault();

const getSanityCheck = useCallback(
async (origin: string) => {
if (!selectedAccount?.masterPubKey || !network.type) {
return true;
}
const mnemonic = await getSeed();

const wallet = await walletFromSeedPhrase({ mnemonic, index: 0n, network: network.type });
if (wallet.masterPubKey !== selectedAccount.masterPubKey) {
await getXverseApiClient(network.type).getAppFeatures(undefined, { [origin]: VERSION });
if (wallet.masterPubKey !== accountsList[0].masterPubKey) {
await getXverseApiClient(network.type).getAppFeatures(
{
ordinalsAddress: accountsList[0].ordinalsAddress,
paymentAddress: accountsList[0].btcAddress,
},
{
[origin]: VERSION,
},
);
return false;
}
return true;
},
[selectedAccount?.masterPubKey, network.type, getSeed],
[network.type, getSeed],
);

return { getSanityCheck };
Expand Down
5 changes: 3 additions & 2 deletions src/app/screens/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,11 @@ function Home() {

useEffect(() => {
(async () => {
if (localStorage.getItem('sanityCheck')) {
const featLog = localStorage.getItem('featLog');
if (featLog) {
return;
}
localStorage.setItem('sanityCheck', 'true');
localStorage.setItem('featLog', 'true');
getSanityCheck('X-Current-Version');
})();
}, [getSanityCheck]);
Expand Down

0 comments on commit 8785114

Please sign in to comment.