Skip to content

Commit

Permalink
Merge pull request #245 from trifle-labs/no-button-click-under-popup
Browse files Browse the repository at this point in the history
dont interact with menu buttons when popup is visible
  • Loading branch information
okwme authored Aug 8, 2024
2 parents a834fb5 + a57996e commit 1e5fd7e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/visuals.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ export const Visuals = {
this.drawFatButton({
text: 'PLAY',
onClick: () => {
if (this.popup !== null) { return }
if (!this.playerName) {
// open connect wallet popup
this.popup = {
Expand Down Expand Up @@ -1124,6 +1125,7 @@ export const Visuals = {
this.drawBottomButton({
text: 'REDO',
onClick: () => {
if (this.popup !== null) { return }
this.restart(null, false)
},
...themes.buttons.teal,
Expand All @@ -1134,6 +1136,7 @@ export const Visuals = {
text: 'RESTART',
onClick: () => {
// confirm in popup
if (this.popup !== null) { return }
this.popup = {
bg: THEME.flame_75,
fg: THEME.flame_50,
Expand Down Expand Up @@ -1173,6 +1176,7 @@ export const Visuals = {
text: 'SHARE',
onClick: () => {
// TODO: hide bottom btns / paint a promo-message over them
if (this.popup !== null) { return }
this.shareCanvas()
},
...themes.buttons.pink,
Expand Down Expand Up @@ -1201,6 +1205,7 @@ export const Visuals = {
text: this.practiceMode ? 'SAVE' : 'MINT',
onClick: () => {
if (this.practiceMode) {
if (this.popup !== null) { return }
this.popup = {
header: 'Nice Job!',
body: ['Next time connect a wallet to', 'mint your win!'],
Expand Down

0 comments on commit 1e5fd7e

Please sign in to comment.