Fix sats output
This commit is contained in:
@@ -679,12 +679,6 @@ export function ActionWizardScreen(): React.ReactElement {
|
|||||||
Type your value, then press Enter to continue
|
Type your value, then press Enter to continue
|
||||||
</Text>
|
</Text>
|
||||||
</Box>
|
</Box>
|
||||||
<Box marginTop={1} borderStyle="single" borderColor="yellow" paddingX={1}>
|
|
||||||
<Text color="yellow">DEBUG - Variable values:</Text>
|
|
||||||
{variables.map((v, i) => (
|
|
||||||
<Text key={i} color="yellow"> {i}: "{v.value}"</Text>
|
|
||||||
))}
|
|
||||||
</Box>
|
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -225,37 +225,32 @@ export function InvitationScreen(): React.ReactElement {
|
|||||||
try {
|
try {
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
|
|
||||||
// Step 1: Check/show current state
|
// Step 1: Check available roles
|
||||||
setStatus('Checking invitation state...');
|
setStatus('Checking available roles...');
|
||||||
|
const availableRoles = await invitationController.getAvailableRoles(invId);
|
||||||
|
|
||||||
// Step 2: Accept invitation if not already accepted
|
if (availableRoles.length === 0) {
|
||||||
setStatus('Accepting invitation...');
|
// Already participating, check if we can add inputs
|
||||||
try {
|
showInfo('You are already participating in this invitation. Checking if inputs are needed...');
|
||||||
await invitationController.acceptInvitation(invId);
|
} else {
|
||||||
} catch (e) {
|
// Need to accept a role first
|
||||||
// May already be accepted, continue
|
// TODO: Let user pick role if multiple available
|
||||||
console.log('Accept error (may be already accepted):', e);
|
// For now, auto-select the first available role
|
||||||
|
const roleToTake = availableRoles[0];
|
||||||
|
showInfo(`Accepting invitation as role: ${roleToTake}`);
|
||||||
|
setStatus(`Accepting as ${roleToTake}...`);
|
||||||
|
|
||||||
|
try {
|
||||||
|
await invitationController.acceptInvitation(invId);
|
||||||
|
} catch (e) {
|
||||||
|
showError(`Failed to accept role: ${e instanceof Error ? e.message : String(e)}`);
|
||||||
|
setStatus('Ready');
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Step 3: Get missing requirements
|
// Step 2: Check if invitation already has inputs or needs funding
|
||||||
setStatus('Checking missing requirements...');
|
setStatus('Analyzing invitation...');
|
||||||
const missing = await invitationController.getMissingRequirements(invId);
|
|
||||||
missing.inputs
|
|
||||||
|
|
||||||
// Check if there are missing outputs that need inputs
|
|
||||||
const missingOutputs = missing.outputs;
|
|
||||||
const missingInputs = missing.inputs;
|
|
||||||
|
|
||||||
// If nothing is missing, we're done
|
|
||||||
if (!missingOutputs?.length && !missingInputs?.length) {
|
|
||||||
loadInvitations();
|
|
||||||
showInfo('No requirements to fill! The invitation may be ready to sign.');
|
|
||||||
setStatus('Ready');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Step 4: Find suitable UTXOs
|
|
||||||
setStatus('Finding suitable UTXOs...');
|
|
||||||
|
|
||||||
// Get the tracked invitation with updated state
|
// Get the tracked invitation with updated state
|
||||||
const tracked = invitationController.getInvitation(invId);
|
const tracked = invitationController.getInvitation(invId);
|
||||||
|
|||||||
Reference in New Issue
Block a user