Replace inline data-URL image handling with a persistent attachment storage service, add draft lifecycle states (active/abandoned/sent) with generation tracking, and update fetchAgent to return project placement alongside agent snapshots.
21 lines
412 B
TypeScript
21 lines
412 B
TypeScript
export function shouldSkipDraftPersist(input: {
|
|
isControlled: boolean;
|
|
currentGeneration: number;
|
|
hydratedGeneration: number;
|
|
isCurrentGeneration: boolean;
|
|
}): boolean {
|
|
if (input.isControlled) {
|
|
return false;
|
|
}
|
|
|
|
if (input.currentGeneration <= 0) {
|
|
return true;
|
|
}
|
|
|
|
if (!input.isCurrentGeneration) {
|
|
return true;
|
|
}
|
|
|
|
return input.hydratedGeneration !== input.currentGeneration;
|
|
}
|