合并页面恢复钱包刷新
将可见性与焦点事件合并到同一零延迟刷新任务,避免前台切换产生连续请求。 卸载时清理待执行定时器,并补充双事件回归测试。
This commit is contained in:
@@ -267,7 +267,7 @@ describe('PlatformEntryActiveFlowShell', () => {
|
||||
await screen.findByLabelText('泥点 67');
|
||||
});
|
||||
|
||||
it('refreshes the shared wallet when the authenticated page regains focus', async () => {
|
||||
it('coalesces visibility and focus refreshes when the page returns to the foreground', async () => {
|
||||
authUiMock.value.user = {
|
||||
id: 'user-1',
|
||||
publicUserCode: '100001',
|
||||
@@ -300,6 +300,7 @@ describe('PlatformEntryActiveFlowShell', () => {
|
||||
await screen.findByLabelText('泥点 10');
|
||||
|
||||
await act(async () => {
|
||||
document.dispatchEvent(new Event('visibilitychange'));
|
||||
window.dispatchEvent(new Event('focus'));
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user