Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aeadf94c40 |
No files matched your search
@@ -48,7 +48,7 @@ function clearPopupCaches() {
|
|||||||
// waits for the lock (followStoredSettings() in src/popup/index.js): that
|
// waits for the lock (followStoredSettings() in src/popup/index.js): that
|
||||||
// follow runs first, and this switch is made after it.
|
// follow runs first, and this switch is made after it.
|
||||||
//
|
//
|
||||||
// The save writes only the fields that differ from what this page last saved.
|
// The save writes only the fields that this page changed since its last save.
|
||||||
// When this page last saved a balance of "0", clearing that balance is no
|
// When this page last saved a balance of "0", clearing that balance is no
|
||||||
// change. So the switch also resets these fields in the stored record:
|
// change. So the switch also resets these fields in the stored record:
|
||||||
//
|
//
|
||||||
|
|||||||
+3
-3
@@ -592,9 +592,9 @@ function reportSaveFailure(err) {
|
|||||||
// `beforeWrite`, when given, is called inside the lock with the stored record
|
// `beforeWrite`, when given, is called inside the lock with the stored record
|
||||||
// as just read, before this page's state is compared against it. It may change
|
// as just read, before this page's state is compared against it. It may change
|
||||||
// `state`, and this save writes that change. It may also change the stored
|
// `state`, and this save writes that change. It may also change the stored
|
||||||
// record. A field that this page did not change is then written as
|
// record: a field that this page did not change is written as `beforeWrite`
|
||||||
// `beforeWrite` left it. When it returns false, nothing is written; any other
|
// left it. When it returns false, nothing is written; any other return lets the
|
||||||
// return lets the save go ahead.
|
// save go ahead.
|
||||||
function saveState(beforeWrite) {
|
function saveState(beforeWrite) {
|
||||||
const turn = withLock("autistmask", () => saveStateOnce(beforeWrite));
|
const turn = withLock("autistmask", () => saveStateOnce(beforeWrite));
|
||||||
// Every failed save is reported, whether or not the caller awaited this
|
// Every failed save is reported, whether or not the caller awaited this
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ test("a token another page tracked before a switch in Settings stays in trackedT
|
|||||||
|
|
||||||
// The contract lookup on SettingsAddToken answers on Ethereum Mainnet while the
|
// The contract lookup on SettingsAddToken answers on Ethereum Mainnet while the
|
||||||
// switch to Sepolia waits for the lock. The page adds the token to Ethereum
|
// switch to Sepolia waits for the lock. The page adds the token to Ethereum
|
||||||
// Mainnet's list. The switch then keeps that list for Ethereum Mainnet.
|
// Mainnet's list, and the switch then keeps that list for Ethereum Mainnet.
|
||||||
test("a token added while a switch in Settings waits for the lock stays tracked on Ethereum Mainnet", async () => {
|
test("a token added while a switch in Settings waits for the lock stays tracked on Ethereum Mainnet", async () => {
|
||||||
const boot = await bootOnAddToken("mainnet");
|
const boot = await bootOnAddToken("mainnet");
|
||||||
expect(boot.pageErrors).toEqual([]);
|
expect(boot.pageErrors).toEqual([]);
|
||||||
|
|||||||
Reference in new issue
Block a user