Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: remove duplicate linkConfirmModal code from paint function

The event handling code was incorrectly placed in paint() which doesn't
have access to the event object 'e'. This code already exists correctly
in the act() function.

-41
-41
system/public/aesthetic.computer/disks/chat.mjs
··· 1035 1035 } 1036 1036 } 1037 1037 1038 - // Draw border to indicate interactivity 1039 - // Always show a subtle blinking border, brighter on hover 1040 - if (linkConfirmModal) { 1041 - const { yesBtn, noBtn, action } = linkConfirmModal; 1042 - 1043 - // Handle hover states 1044 - if ((e.is("move") || e.is("draw")) && pen) { 1045 - if (yesBtn && noBtn) { 1046 - linkConfirmModal.hoverYes = pen.x >= yesBtn.x && pen.x < yesBtn.x + yesBtn.w && 1047 - pen.y >= yesBtn.y && pen.y < yesBtn.y + yesBtn.h; 1048 - linkConfirmModal.hoverNo = pen.x >= noBtn.x && pen.x < noBtn.x + noBtn.w && 1049 - pen.y >= noBtn.y && pen.y < noBtn.y + noBtn.h; 1050 - } 1051 - } 1052 - 1053 - // Handle clicks 1054 - if ((e.is("lift") || e.is("touch")) && pen) { 1055 - if (yesBtn && noBtn) { 1056 - const clickedYes = pen.x >= yesBtn.x && pen.x < yesBtn.x + yesBtn.w && 1057 - pen.y >= yesBtn.y && pen.y < yesBtn.y + yesBtn.h; 1058 - const clickedNo = pen.x >= noBtn.x && pen.x < noBtn.x + noBtn.w && 1059 - pen.y >= noBtn.y && pen.y < noBtn.y + noBtn.h; 1060 - 1061 - if (clickedYes) { 1062 - beep(); 1063 - hud.label(piece); // Set back label to current piece 1064 - if (action) action(); // Execute the stored action 1065 - linkConfirmModal = null; 1066 - } else if (clickedNo) { 1067 - beep(); 1068 - linkConfirmModal = null; // Just close 1069 - } 1070 - // Clicking outside buttons also closes the modal 1071 - else { 1072 - beep(); 1073 - linkConfirmModal = null; 1074 - } 1075 - } 1076 - } 1077 - } 1078 - 1079 1038 // Get loading progress (0-1) 1080 1039 const progress = paintingLoadProgress.get(code) || 0; 1081 1040