File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed
Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -631,19 +631,18 @@ function inject (bot, { hideErrors }) {
631631 if ( bot . supportFeature ( 'transactionPacketExists' ) ) {
632632 const response = once ( bot , `confirmTransaction${ actionId } ` )
633633 if ( ! window . transactionRequiresConfirmation ( click ) ) {
634- // Only auto-confirm for inventory window (id 0) clicks
635- // All other window types should wait for server confirmation
636- if ( window . id === 0 ) {
637- confirmTransaction ( window . id , actionId , true )
634+ // For windows that don't require confirmation (like cartography table on old MC),
635+ // skip waiting for server response since it will be rejected anyway
636+ confirmTransaction ( window . id , actionId , true )
637+ } else {
638+ const [ success ] = await withTimeout ( response , WINDOW_TIMEOUT )
639+ . catch ( ( ) => {
640+ throw new Error ( `Server didn't respond to transaction for clicking on slot ${ slot } on window with id ${ window ?. id } .` )
641+ } )
642+ if ( ! success ) {
643+ throw new Error ( `Server rejected transaction for clicking on slot ${ slot } , on window with id ${ window ?. id } .` )
638644 }
639645 }
640- const [ success ] = await withTimeout ( response , WINDOW_TIMEOUT )
641- . catch ( ( ) => {
642- throw new Error ( `Server didn't respond to transaction for clicking on slot ${ slot } on window with id ${ window ?. id } .` )
643- } )
644- if ( ! success ) {
645- throw new Error ( `Server rejected transaction for clicking on slot ${ slot } , on window with id ${ window ?. id } .` )
646- }
647646 } else {
648647 await waitForWindowUpdate ( window , slot )
649648 }
You can’t perform that action at this time.
0 commit comments