Skip to content

Commit 828bafd

Browse files
committed
Fix balance not updating properly
1 parent c71556d commit 828bafd

File tree

5 files changed

+16
-22
lines changed

5 files changed

+16
-22
lines changed

cobweb.crx

-10 Bytes
Binary file not shown.

landing/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ <h2 class="display mx-auto text-center mb-3">get started</h2>
105105
<a href="https://github.com/kewbish/cobweb">available on GitHub</a>
106106
should you wish to build from source. The checksum of the current
107107
version is
108-
<code style="word-break: break-all">7b0e3fa8f5f2217bfd597700ba4689da9d32375347d9da41b6b5ef0380e67ab5</code>.
108+
<code style="word-break: break-all">f8fcf1dcb877899b6b8d9819784605dbb2eb69e8aa11cf075ffc454c6a2cf5df</code>.
109109
</p>
110110
<a href="https://github.com/kewbish/cobweb" class="btn glassy-cw-btn mt-1" role="button">view source</a>
111111
</div>

release/RELEASE_NOTES.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ Release notes:
66
- Fixed bug where errors reading a past stream would prevent the creation of a new one.
77
- Fixed overflow bug on Help page.
88

9-
Download on the [Chrome Webstore](https://chrome.google.com/webstore/detail/agdomcadfhkpkcjceenogkiglbhgpclg?authuser=0&hl=en-GB) ◦ Checksum: `7b0e3fa8f5f2217bfd597700ba4689da9d32375347d9da41b6b5ef0380e67ab5`
9+
Download on the [Chrome Webstore](https://chrome.google.com/webstore/detail/agdomcadfhkpkcjceenogkiglbhgpclg?authuser=0&hl=en-GB) ◦ Checksum: `f8fcf1dcb877899b6b8d9819784605dbb2eb69e8aa11cf075ffc454c6a2cf5df`
1010

1111
**Full Changelog**: https://github.com/kewbish/cobweb/compare/v0.0.10...v0.0.11

release/generateRelease.js

+9-13
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ const { exit } = require("process");
33
const semver = require("semver");
44
const shell = require("shelljs");
55
const cheerio = require("cheerio");
6+
const process = require("node:process");
7+
8+
if (process.cwd() !== "/home/kewbish/Downloads/dev/cobweb-rise") {
9+
console.log("cd to project root first.");
10+
exit(1);
11+
}
612

713
// increment version numbers in package.json and manifest.json
814
const rawdata = fs.readFileSync("package.json");
@@ -36,7 +42,7 @@ if (code !== 0) {
3642
console.error("Packing extension failed.");
3743
exit(1);
3844
}
39-
shell.mv("build.crx", "cobweb.crx");*/
45+
shell.mv("build.crx", "cobweb.crx");
4046

4147
// zip extension to Downloads folder
4248
({ code } = shell.exec("zip /home/kewbish/Downloads/build.zip -r build"));
@@ -57,7 +63,7 @@ const checksum = stdout.trim();
5763
// write to landing page HTML
5864
const rawhtml = fs.readFileSync("landing/index.html");
5965
const $ = cheerio.load(rawhtml);
60-
$('code[style="word-break:break-all;"]').text(checksum);
66+
$('code[style="word-break: break-all"]').text(checksum);
6167
fs.writeFileSync("landing/index.html", $.html());
6268

6369
// update release notes
@@ -69,14 +75,4 @@ rawMD = rawMD.replace(
6975
);
7076
fs.writeFileSync("release/RELEASE_NOTES.md", rawMD);
7177

72-
({ stdout } = shell.exec(`git diff HEAD`));
73-
if (stdout) {
74-
console.log("Repository dirty, skipping tagging")
75-
exit(0)
76-
}
77-
78-
({ code, stdout } = shell.exec(`git add . && git commit --amend --no-edit && git tag v${newVersion}`));
79-
if (code !== 0) {
80-
console.error("Packing extension failed.");
81-
exit(1);
82-
}
78+
console.log(`Remember to tag releases: git tag v${newVersion}`);

src/pages/Background/lib/fetchAndUpdateBalance.ts

+5-7
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,6 @@ const fetchAndUpdateBalance = async ({
4545
const balance = await infuraProvider.getBalance(address);
4646
storage.local.set({ mmBalance: BigNumber.from(balance) });
4747

48-
const mmSigner = mmProvider.getSigner();
49-
50-
if (!cwInitialized || !mmSigner) {
51-
return;
52-
}
53-
5448
({ availableBalance, deposit } = await sfToken.realtimeBalanceOf({
5549
account: address,
5650
providerOrSigner: mmProvider,
@@ -76,7 +70,11 @@ const fetchAndUpdateBalance = async ({
7670
if (balanceRes.eq(constants.Zero)) {
7771
return;
7872
}
79-
if (balanceRes.gt(constants.Zero) && balanceRes.lte(deposit)) {
73+
if (
74+
balanceRes.gt(constants.Zero) &&
75+
balanceRes.lte(deposit) &&
76+
mmProvider.getSigner()
77+
) {
8078
// critical balance
8179
if (sf && mmProvider) {
8280
cleanUpStreams({

0 commit comments

Comments
 (0)