From 315db45fd2c5b6e170162c5d6832a8e1ef991cc3 Mon Sep 17 00:00:00 2001 From: Emilie Ma Date: Mon, 2 Jan 2023 09:56:00 -0800 Subject: [PATCH] Fix Metamask locking issues --- build.crx | Bin 1137211 -> 1137248 bytes landing/index.html | 2 +- src/pages/Background/index.ts | 33 ++++++++++++------ .../Background/lib/fetchAndUpdateBalance.ts | 2 +- src/pages/Popup/ListSettings.tsx | 4 +-- src/pages/Popup/Popup.tsx | 2 +- 6 files changed, 27 insertions(+), 16 deletions(-) diff --git a/build.crx b/build.crx index 05e02564b6466e7008f86d5694a501b997808e7b..47511b887bd297dc3e3c566133a5d6f26fb065f5 100644 GIT binary patch delta 14100 zcmYkDV{jl{u=iuzwryu)W5bPY+nCtc*v@8S+xEt`jg6hWd!Kthyr<@0^Q)fjK6TEA zIW;xi9gPw@jS{u|pn&}K%Bop6bsZX+8*6&A!+eTRq{1sw@4#5_ekZ4$6^b7g9rZv? zLGof)>W!oWr@0qb6%v<;;OJ;HEP^zF?6(p6?%wQ2hy;6*?EUsp8qZhmLVlTFCAEWN zoHVq%fprjn$XnC;KHHDx zZe^1s-3noA))%W%G=40;Z1EYcA^mgjqlFgd`fsx_1N~TT4@08cgKQJL?K={yvR2iG zguJqWQ~A!x@RHqdejK8+n8WN$hDr@@Ph&1R!q61vnPNwj2ZmlKiboH$1gsgl(o}3~ z6j1`poHO2CJ7CdYN&H|W;2Uvd4f zrXJJ7K7@o=nluX;DJdRY#jUJsm}5VlRy`EBMK>5hl_;S1h;_7L*d00&K!*fth@PUN zjX0tmhy&*$GDRbsiUl|00#s1|20lEs$p*AVkTJdt$xCVUYbe-~t|yT3AKW_WS~Sf| zWsvzW#1d6ic+BcrIhz+yVv3w`)#S-YKfodO_=&T^)Ho3&Pg^h&jS3=z&|Xxt>a;@JnuLuQXH2A?)?e9+RT$G z8T<3?UV#23^yUv~i^S4L_9gT1$AiFGS6#yz3A)6?X7hkNF&7Nma!H&I@b%Xartoo*@$> z805mRe97KZuF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BI?N{MxpE7rW>0G$-}CIz;Z@d$qDcEJWQY4F^%O2P?m>)WCVd=VL|^| zh{E;5VE+NvtRDt19{4}~M&bF82>(F*2U2rBB=Vx~|BR;j1IU;EBh8LM$X*Kn+0g_t zSoMD?XZ|S7Xa1;0EB{SZ)I#I=Pa?I@xc-wqEj01}1XdeO>_1V^M&thfTA0!jwb3~K zyEv+ih7Ym)9X8EA3>FVXSsn}=1j6{gcbtZ*gN6@AoW`JoM)bd>{>A*y{>UI_Cua|5 zCTn*G`~NRRQwlOjiA4bf;;;jOa6td>aTget started download

-

Cobweb is MIT-licensed and fully open source - the source is available on GitHub should you wish to build from source. The checksum of the current version is 29aec681ca1ed9d2da4f09bf558012dec69ef8f7bf81e1ccbcf8521602db7df2. +

Cobweb is MIT-licensed and fully open source - the source is available on GitHub should you wish to build from source. The checksum of the current version is e76cb27d110f9544d3345644827af159e2750ffaad9e0660d63a931c907a32ba.

view source
diff --git a/src/pages/Background/index.ts b/src/pages/Background/index.ts index f3b6806..f1fc5fc 100644 --- a/src/pages/Background/index.ts +++ b/src/pages/Background/index.ts @@ -2,7 +2,7 @@ // https://github.com/tsarpaul/citadelnfts-extension/blob/master/patch_metamask_provider.py import createMetaMaskProvider from "metamask-extension-provider"; import { MetaMaskInpageProvider } from "@metamask/inpage-provider"; -import { BigNumber, ethers, constants, Signer } from "ethers"; +import { BigNumber, ethers } from "ethers"; import { Framework } from "@superfluid-finance/sdk-core"; import { INFURA_PROJECT_ID, @@ -62,16 +62,28 @@ metamaskProvider.on("disconnect", () => { storage.local.set({ mmNotFound: true }); }); +metamaskProvider.on("connect", async () => { + try { + storage.local.set({ + mmNotFound: (await mmProvider.listAccounts()).length === 0, + }); + } catch { + storage.local.set({ mmNotFound: true }); + } +}); + metamaskProvider.on("accountsChanged", (accounts) => { - setNewAddress({ - address: (accounts as Array)[0], - provider: mmProvider, - }); + if ((accounts as Array).length === 0) { + storage.local.set({ mmNotFound: true }); + } else { + setNewAddress({ + address: (accounts as Array)[0], + provider: mmProvider, + }); + } }); -export const mmProvider = new ethers.providers.Web3Provider( - metamaskProvider as any -); +const mmProvider = new ethers.providers.Web3Provider(metamaskProvider as any); storage.local.set({ toasts: [] }); @@ -82,6 +94,9 @@ if (!addressTry || addressTry === "NO_ADDRESS") { storage.local.set({ address: metamaskProvider.selectedAddress ?? "NO_ADDRESS", }); + if (!metamaskProvider.selectedAddress) { + storage.local.set({ mmNotFound: true }); + } } let infuraProvider: InfuraProvider | null = null; @@ -378,5 +393,3 @@ chrome.alarms.onAlarm.addListener(async (alarm) => { } } catch {} }); - -chrome.runtime.onConnect.addListener(() => {}); diff --git a/src/pages/Background/lib/fetchAndUpdateBalance.ts b/src/pages/Background/lib/fetchAndUpdateBalance.ts index 2f6d601..dae866d 100644 --- a/src/pages/Background/lib/fetchAndUpdateBalance.ts +++ b/src/pages/Background/lib/fetchAndUpdateBalance.ts @@ -1,7 +1,7 @@ import { storage } from "@extend-chrome/storage"; import { Web3Provider } from "@ethersproject/providers"; import { Framework, SuperToken } from "@superfluid-finance/sdk-core"; -import { BigNumber, constants, Signer, utils } from "ethers"; +import { BigNumber, constants, utils } from "ethers"; import errorToast, { toast } from "../../shared/toast"; import { DELETE_STREAM } from "../../shared/events"; import { Rate } from "../../shared/types"; diff --git a/src/pages/Popup/ListSettings.tsx b/src/pages/Popup/ListSettings.tsx index 0428450..77d7167 100644 --- a/src/pages/Popup/ListSettings.tsx +++ b/src/pages/Popup/ListSettings.tsx @@ -1,4 +1,4 @@ -import React, { useEffect } from "react"; +import React from "react"; import { useChromeStorageLocal } from "use-chrome-storage"; import { useState } from "react"; import { PayRates, Rate, RateSettings, Stream } from "../shared/types"; @@ -9,8 +9,6 @@ import Setting from "./components/Setting"; import "bootstrap-icons/font/bootstrap-icons.css"; import { UPDATE_STREAM } from "../shared/events"; import CobwebPage from "./components/CobwebPage"; -// @ts-expect-error -import bootstrap from "bootstrap/dist/js/bootstrap.bundle"; import { toast } from "../shared/toast"; import verifySignature from "../shared/verifySignature"; import ToastHandler from "./components/ToastHandler"; diff --git a/src/pages/Popup/Popup.tsx b/src/pages/Popup/Popup.tsx index dbf84d7..de80ebe 100644 --- a/src/pages/Popup/Popup.tsx +++ b/src/pages/Popup/Popup.tsx @@ -1,4 +1,4 @@ -import { ethers, BigNumber, constants } from "ethers"; +import { ethers, BigNumber } from "ethers"; import React, { useEffect, useState } from "react"; import { Link, Navigate, useSearchParams } from "react-router-dom"; import {