Address remaining PR review comments

- Fix getAllInstances to handle empty instance array without throwing
- Persist updated token expiry timestamps to disk after refresh
- Mark internal httpJson helpers as @internal instead of @public

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
This commit is contained in:
Patrik Oldsberg
2026-03-17 20:35:27 +01:00
parent 6cc77e2b50
commit 4d25b4b784
5 changed files with 36 additions and 7 deletions
@@ -96,6 +96,9 @@ export async function getAllInstances(): Promise<{
selected: StoredInstance | undefined;
}> {
const { instances } = await readAll();
if (instances.length === 0) {
return { instances: [], selected: undefined };
}
const selected = instances.find(i => i.selected) ?? instances[0];
return {
instances: instances.map(i => ({