generated from coulomb/repo-seed
Server sync, erroneous doc handling, and @binect/js v0.1.0 integration
- Add server sync to discover documents uploaded elsewhere (fixes missing basket documents issue) - Handle erroneous uploads: preserve binectDocumentId for delete button - Add "Delete from server" button for erroneous and canceled documents - Remove archive button for active documents (in_basket, in_production) - Auto-restore archived documents that have active status - Refactor to use @binect/js v0.1.0 features: - DocumentStatus enum instead of magic numbers - isErroneous(), getErrors() helper functions - getStatusDescription() for status text - Add binect-js improvement requirements document Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -205,7 +205,8 @@ export async function syncFromServer(
|
||||
binectStatusCode: number,
|
||||
binectStatusText: string,
|
||||
price?: number,
|
||||
recipientAddress?: string
|
||||
recipientAddress?: string,
|
||||
errorMessage?: string
|
||||
): Promise<DocumentProxy> {
|
||||
const state = await loadQueue();
|
||||
|
||||
@@ -219,6 +220,7 @@ export async function syncFromServer(
|
||||
proxy.binectStatus = mapBinectStatusCode(binectStatusCode);
|
||||
if (price !== undefined) proxy.price = price;
|
||||
if (recipientAddress) proxy.recipientAddress = recipientAddress;
|
||||
if (errorMessage) proxy.errorMessage = errorMessage;
|
||||
} else {
|
||||
// Create new proxy from server data
|
||||
proxy = {
|
||||
@@ -234,7 +236,8 @@ export async function syncFromServer(
|
||||
binectStatusCode,
|
||||
binectStatusText,
|
||||
price,
|
||||
recipientAddress
|
||||
recipientAddress,
|
||||
errorMessage
|
||||
};
|
||||
state.entries.unshift(proxy);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user