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
|
||||
</Text>
|
||||
</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>
|
||||
);
|
||||
|
||||
|
||||
@@ -225,37 +225,32 @@ export function InvitationScreen(): React.ReactElement {
|
||||
try {
|
||||
setIsLoading(true);
|
||||
|
||||
// Step 1: Check/show current state
|
||||
setStatus('Checking invitation state...');
|
||||
// Step 1: Check available roles
|
||||
setStatus('Checking available roles...');
|
||||
const availableRoles = await invitationController.getAvailableRoles(invId);
|
||||
|
||||
// Step 2: Accept invitation if not already accepted
|
||||
setStatus('Accepting invitation...');
|
||||
try {
|
||||
await invitationController.acceptInvitation(invId);
|
||||
} catch (e) {
|
||||
// May already be accepted, continue
|
||||
console.log('Accept error (may be already accepted):', e);
|
||||
if (availableRoles.length === 0) {
|
||||
// Already participating, check if we can add inputs
|
||||
showInfo('You are already participating in this invitation. Checking if inputs are needed...');
|
||||
} else {
|
||||
// Need to accept a role first
|
||||
// TODO: Let user pick role if multiple available
|
||||
// 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
|
||||
setStatus('Checking missing requirements...');
|
||||
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...');
|
||||
// Step 2: Check if invitation already has inputs or needs funding
|
||||
setStatus('Analyzing invitation...');
|
||||
|
||||
// Get the tracked invitation with updated state
|
||||
const tracked = invitationController.getInvitation(invId);
|
||||
|
||||
Reference in New Issue
Block a user