fix: an open popup follows a network switch the background saves (closes #650)
When the background saves a network switch after the user approves a site's request, or another popup page saves one, an open popup takes the new network from the stored record inside a save, holding the lock, and checks the record once at start-up for a switch saved before it listened. It then leaves the page as a switch in Settings does: the cut and the redraw are two Settings functions both paths call, and both reset the popup's caches through one function. A switch in Settings is now made inside its own save too, so one picked while a follow waits for the lock is made after it. The popup never switches the network itself. Model: opus-5-5
This commit is contained in:
@@ -161,6 +161,7 @@ test("a token added by contract address on Sepolia is tracked on Sepolia only",
|
||||
);
|
||||
expect(stored().trackedTokens).toEqual([SEPOLIA_TOKEN]);
|
||||
|
||||
await boot.click("btn-settings");
|
||||
await chooseNetwork(boot, "mainnet");
|
||||
expect(stored().networkId).toBe("mainnet");
|
||||
expect(stored().trackedTokens).toEqual([MAINNET_TOKEN]);
|
||||
|
||||
Reference in New Issue
Block a user