Skip to content

Commit

Permalink
🐛Run button disable failed when running
Browse files Browse the repository at this point in the history
  • Loading branch information
soaibsafi committed Jan 10, 2024
1 parent 59832bc commit 11e57ca
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions frontend/src/components/Playground/Playground.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,12 @@ const Playground = ({ editorValue, setEditorValue, language, setLanguage }) => {

if (language.value >= 0 && language.value < 3) {
run_limboole(window.Wrappers[language.value], editorValue)
setIsExecuting(false);
} else if (language.value == 3) {
executeZ3(editorValue)
.then((res) => {
setOutput(res.result)
setIsExecuting(false);
})
.catch((err) => {
if (err.response.status === 503) {
Expand All @@ -169,14 +171,13 @@ const Playground = ({ editorValue, setEditorValue, language, setLanguage }) => {
else if (err.response.status === 429) {
showErrorModal("Slow down! You are making too many requests. Please try again later.")
}
else {
showErrorModal(`Something went wrong. Please try again later.${err.message}`)
}
setIsExecuting(false);
})
} else if (language.value == 4) {
executeNuxmv(editorValue)
.then((res) => {
setOutput(res.result)
setIsExecuting(false);
})
.catch((err) => {
if (err.response.status === 503) {
Expand All @@ -185,9 +186,7 @@ const Playground = ({ editorValue, setEditorValue, language, setLanguage }) => {
else if (err.response.status === 429) {
showErrorModal("Slow down! You are making too many requests. Please try again later.")
}
else {
showErrorModal(`Something went wrong. Please try again later.${err.message}`)
}
setIsExecuting(false);
})
} else if (language.value == 5) {
console.log('Executing Alloy')
Expand All @@ -200,10 +199,8 @@ const Playground = ({ editorValue, setEditorValue, language, setLanguage }) => {
showErrorModal('Code too long. Please reduce the size of the code.')
}
else {
showErrorModal(`Something went wrong. Please try again later.+${err.message}`)
showErrorModal(`Something went wrong. Please try again later.${err.message}`)
}
} finally {
setIsExecuting(false);
}
}

Expand Down

0 comments on commit 11e57ca

Please sign in to comment.