fix(projects): block interactions during animation

This commit is contained in:
2025-12-17 21:02:21 +01:00
parent 4aac82a97c
commit 9eed7fe3e6

View File

@@ -79,7 +79,7 @@ const startButtonAnimation = (type: ButtonType) => {
}; };
useScreenClick((x, y) => { useScreenClick((x, y) => {
if (currentAnimation) return; if (currentAnimation || store.isIntro || store.isOutro) return;
const project = store.projects[store.currentProject]; const project = store.projects[store.currentProject];
if (circleContains(BUTTONS.prev.position, [x, y], CLICK_RADIUS)) { if (circleContains(BUTTONS.prev.position, [x, y], CLICK_RADIUS)) {
@@ -131,7 +131,7 @@ useRender((ctx) => {
ctx.fillRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); ctx.fillRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
}); });
useKeyDown((key) => { useKeyDown((key) => {
if (currentAnimation) return; if (currentAnimation || store.isIntro || store.isOutro) return;
switch (key) { switch (key) {
case "NDS_LEFT": case "NDS_LEFT":
startButtonAnimation("prev"); startButtonAnimation("prev");