Persist last publish report across restarts

This commit is contained in:
Avi 2026-09-01 12:32:28 -05:00
commit bab82f5148
7 changed files with 63 additions and 3 deletions

View file

@ -140,6 +140,12 @@ export interface AppState {
settings: Settings;
/** Recently deleted profiles, newest last, for undo. */
undo_history?: ProfileSummary[];
/** The most recent publish report, persisted across restarts. */
last_publish?: {
event_id: string;
succeeded: string[];
failed: RelayFailure[];
} | null;
}
/** A secret key revealed after the vault is unlocked. */

View file

@ -98,6 +98,9 @@ export function AppProvider({ children }: { children: ReactNode }) {
const initial = await api.init();
if (!cancelled) {
setState(initial);
if (initial.last_publish) {
setLastPublish({ report: initial.last_publish, error: null, details: null, at: Date.now() });
}
}
} catch (error) {
if (!cancelled) {

View file

@ -43,6 +43,7 @@ export function makeState(overrides?: Partial<AppState>): AppState {
active_profile: alice,
profiles: [alice, bob],
settings,
last_publish: null,
...overrides,
};
}