Last active
December 6, 2019 13:10
-
-
Save amorfati0310/3aef76d415f35f149240b5fed7634b6f to your computer and use it in GitHub Desktop.
temp1206.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function clickHandler() { | |
if (content === 'empty' || content === 'addDone') modalOff(); | |
else if (nickname === '') switchContent('empty'); | |
else if (content === 'add') { | |
switchContent('addDone'); | |
await sendFriendRequestFunc({ | |
variables: { id: testId, nickname }, | |
}); | |
} else if (content === 'delete') { | |
switchContent('deleteDone'); | |
await deleteFriendFunc({ variables: { id: testId, nickname } }); | |
setRefresh(true); | |
} else if (content === 'deleteDone') { | |
modalOff(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function clickHandler() { | |
try { | |
switch case(content){ | |
case empty: { | |
return modalOff(); | |
} | |
case addDone: { | |
return modalOff(); | |
} | |
case add: { | |
switchContent('addDone'); | |
await sendFriendRequestFunc({ | |
variables: { id: testId, nickname }, | |
}); | |
case delete: { | |
switchContent('deleteDone'); | |
await deleteFriendFunc({ variables: { id: testId, nickname } }); | |
setRefresh(true); | |
}, | |
case deleteDone: { | |
modalOff(); | |
} | |
default: break; | |
} | |
} | |
catch(e){ | |
console.error(e); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment