From 95ed6d6903a3f933d498aa697911a7bfceef67d8 Mon Sep 17 00:00:00 2001 From: Jason Date: Sat, 10 Jan 2026 11:05:18 +0800 Subject: [PATCH] fix(usage): prevent usage script config from leaking between providers Add key prop to UsageScriptModal to ensure component remounts when switching between different providers. This fixes issue #569 where configuring usage query for one provider would incorrectly apply the same configuration to all providers. The root cause was that useState initialization only runs on first mount, and due to useLastValidValue hook keeping the modal rendered during close animation, the component might not fully unmount when switching providers rapidly. Closes #569 --- src-tauri/Cargo.lock | 2 +- src/App.tsx | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 51a67662..e48e0090 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -701,7 +701,7 @@ dependencies = [ [[package]] name = "cc-switch" -version = "3.9.0" +version = "3.9.1" dependencies = [ "anyhow", "async-stream", diff --git a/src/App.tsx b/src/App.tsx index 65e08ba4..a78d9ce1 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -806,6 +806,7 @@ function App() { {effectiveUsageProvider && (