Persist last publish report across restarts
This commit is contained in:
parent
e936524f72
commit
bab82f5148
7 changed files with 63 additions and 3 deletions
|
|
@ -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. */
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ export function makeState(overrides?: Partial<AppState>): AppState {
|
|||
active_profile: alice,
|
||||
profiles: [alice, bob],
|
||||
settings,
|
||||
last_publish: null,
|
||||
...overrides,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue