mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-24 12:44:18 +08:00
fix(import): refresh all providers immediately after SQL import
- Remove setTimeout delay that could be cancelled on component unmount - Invalidate all providers cache (not just current app) since import affects all apps - Call onImportSuccess before sync to ensure UI refresh even if sync fails - Update i18n: "Data refreshed" (past tense, reflecting immediate action)
This commit is contained in:
@@ -110,12 +110,6 @@ describe("useImportExport Hook", () => {
|
||||
expect(result.current.status).toBe("success");
|
||||
expect(result.current.backupId).toBe("backup-123");
|
||||
expect(toastSuccessMock).toHaveBeenCalledTimes(1);
|
||||
|
||||
// Skip delay to execute callback
|
||||
await act(async () => {
|
||||
vi.runOnlyPendingTimers();
|
||||
});
|
||||
|
||||
expect(onImportSuccess).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user