Add sidebar action to select the active request

This commit is contained in:
Gregory Schier
2025-11-11 14:38:05 -08:00
parent 7b6278405c
commit 5449e3c620
4 changed files with 52 additions and 14 deletions

View File

@@ -83,6 +83,17 @@ export function getModel<M extends AnyModel['model'], T extends ExtractModel<Any
return null;
}
export function getAnyModel(
id: string,
): AnyModel | null {
let data = mustStore().get(modelStoreDataAtom);
for (const t of Object.keys(data)) {
let v = (data as any)[t]?.[id];
if (v?.model === t) return v;
}
return null;
}
export function patchModelById<M extends AnyModel['model'], T extends ExtractModel<AnyModel, M>>(
model: M,
id: string,