Skip to content

Commit c0f7f93

Browse files
committed
refactor: check of help in function
1 parent a98c47c commit c0f7f93

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Diff for: src/components/VueCommandQuery.vue

+7-4
Original file line numberDiff line numberDiff line change
@@ -167,14 +167,19 @@ const reverseISearch = event => {
167167
// TODO
168168
// console.debug(event)
169169
}
170+
// Shows a user defined help text as placeholder after timeout millseconds
170171
const showDelayedHelp = () => {
172+
if (and(!showHelp, isOutdated.value)) {
173+
return
174+
}
175+
171176
const timeout = setTimeout(() => {
172177
placeholder.value = helpText
173178
}, helpTimeout)
174179
175-
const unwatchIsDisabled = watch(isOutdated, () => {
180+
const unwatchIsOutdated = watch(isOutdated, () => {
176181
clearTimeout(timeout)
177-
unwatchIsDisabled()
182+
unwatchIsOutdated()
178183
})
179184
}
180185
// Deactivates this query and dispatches it to execute the command
@@ -217,9 +222,7 @@ onMounted(() => {
217222
focus()
218223
219224
// Show eventually help as placeholder
220-
if (and(showHelp, !isOutdated.value)) {
221225
showDelayedHelp()
222-
}
223226
})
224227
225228
defineExpose({

0 commit comments

Comments
 (0)