Skip to content

Commit

Permalink
fix: multi event bind labring#241 (labring#255)
Browse files Browse the repository at this point in the history
  • Loading branch information
LeezQ committed Sep 19, 2022
1 parent 0d7a868 commit 82b4b75
Showing 1 changed file with 26 additions and 8 deletions.
34 changes: 26 additions & 8 deletions packages/web/src/pages/app/[appid]/cloudfunction/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,19 @@ async function updateFunc(showTip = true) {
}
async function launch() {
const r = await compileFunctionCode(func._id, {
code: value,
}).finally(() => {
loading = false
})
if (loading)
return
loading = true
const r = await compileFunctionCode(func._id, {
code: value,
}).finally(
() => {
loading = false
},
)
const param = parseInvokeParam(invokeParams)
const res = await launchFunction(r.data, param, debug_token).finally(
() => {
Expand Down Expand Up @@ -318,13 +321,28 @@ onMounted(async () => {
nextTick(() => {
updateEditorHeight()
document.removeEventListener('keydown', bindShortKey, false)
document.addEventListener('keydown', bindShortKey, false)
window.addEventListener('resize', debounce(() => {
updateEditorHeight()
}))
})
})
onBeforeUnmount(() => {
document.removeEventListener('keydown', bindShortKey, false)
})
onUnmounted(() => {
document.removeEventListener('keydown', bindShortKey, false)
})
onActivated(() => {
document.removeEventListener('keydown', bindShortKey, false)
document.addEventListener('keydown', bindShortKey, false)
})
onDeactivated(() => {
document.removeEventListener('keydown', bindShortKey, false)
})
</script>

<template>
Expand Down

0 comments on commit 82b4b75

Please sign in to comment.