fix(ui): stop the add-provider modal from shifting while it loads (#13179)

This commit is contained in:
Alejandro Bailo authored and GitHub committed 2026-10-27 20:53:00 +01:00
1 parent 75c9a6bf51
commit dcd3d5a0fb
22 files changed
+799 -151

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
import { create } from "zustand";
interface LighthouseLlmStoreState {
// Last answer this page load (null: never checked), shown at once on reopen.
hasConnectedLlm: boolean | null;
// Id of the newest check: an older check that answers late is ignored.
latestCheck: number;
startCheck: () => number;
settleCheck: (check: number, hasConnectedLlm: boolean) => void;
}
export const useLighthouseLlmStore = create<LighthouseLlmStoreState>(
(set, get) => ({
hasConnectedLlm: null,
latestCheck: 0,
startCheck: () => {
const check = get().latestCheck + 1;
set({ latestCheck: check });
return check;
},
settleCheck: (check, hasConnectedLlm) => {
if (check === get().latestCheck) set({ hasConnectedLlm });
},
}),
);