ToS; persistent pref store; package upgrade

This commit is contained in:
tim
2024-11-19 21:23:00 -04:00
parent bb4f7d4607
commit a689766f37
10 changed files with 1575 additions and 110 deletions

View File

@@ -1,7 +1,7 @@
import {BrowserProvider, ethers} from "ethers";
import {useStore} from "@/store/store";
import {socket} from "@/socket.js";
import {SingletonCoroutine, uuid} from "@/misc.js";
import {SingletonCoroutine} from "@/misc.js";
import {newContract, vaultAddress, vaultContract} from "@/blockchain/contract.js";
import {defineStore} from "pinia";
import {ref} from "vue";
@@ -418,18 +418,18 @@ function doSendTransaction(sender, signer, errHandler) {
export async function detectUpgrade() {
if (!provider) {
console.log('no provider!')
return 0
return null
}
const s = useStore()
if (!s.vault) {
console.log('no vault logged in')
return 0
return null
}
const info = version.chainInfo[s.chainId]
if (!info) {
console.log(`couldn't get chainInfo for ${s.chainId}`)
return 0
return null
}
try {
console.log('factory', info.factory)
@@ -451,7 +451,7 @@ export async function detectUpgrade() {
catch (e) {
console.log('ignorable error while querying for an upgrade', e)
}
return 0
return null
}