Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

Fix timer type warning when passing to clearInterval

天舟95f14e1f4752
diff --git a/frontend/src/components/VCSProviderBasicInfoPanel.vue b/frontend/src/components/VCSProviderBasicInfoPanel.vue
index 3b73c10190..0592834c48 100644
--- a/frontend/src/components/VCSProviderBasicInfoPanel.vue
+++ b/frontend/src/components/VCSProviderBasicInfoPanel.vue
@@ -100,7 +100,9 @@ export default {
});
onUnmounted(() => {
- clearInterval(state.urlValidationTimer);
+ if (state.urlValidationTimer) {
+ clearInterval(state.urlValidationTimer);
+ }
});
const namePlaceholder = computed((): string => {
@@ -120,7 +122,9 @@ export default {
const changeURL = (value: string) => {
props.config.instanceURL = value;
- clearInterval(state.urlValidationTimer);
+ if (state.urlValidationTimer) {
+ clearInterval(state.urlValidationTimer);
+ }
// If text becomes valid, we immediately clear the error.
// otherwise, we delay TEXT_VALIDATION_DELAY to do the validation in case there is continous keystroke.
if (isURL(props.config.instanceURL)) {
diff --git a/frontend/src/components/VCSProviderOAuthPanel.vue b/frontend/src/components/VCSProviderOAuthPanel.vue
index 2e37c3a535..e0b0ee991c 100644
--- a/frontend/src/components/VCSProviderOAuthPanel.vue
+++ b/frontend/src/components/VCSProviderOAuthPanel.vue
@@ -138,8 +138,12 @@ export default {
});
onUnmounted(() => {
- clearInterval(state.applicationIdValidationTimer);
- clearInterval(state.secretValidationTimer);
+ if (state.applicationIdValidationTimer) {
+ clearInterval(state.applicationIdValidationTimer);
+ }
+ if (state.secretValidationTimer) {
+ clearInterval(state.secretValidationTimer);
+ }
});
const createAdminApplicationURL = computed((): string => {
@@ -152,7 +156,9 @@ export default {
const changeApplicatonId = (value: string) => {
props.config.applicationId = value;
- clearInterval(state.applicationIdValidationTimer);
+ if (state.applicationIdValidationTimer) {
+ clearInterval(state.applicationIdValidationTimer);
+ }
// If text becomes valid, we immediately clear the error.
// otherwise, we delay TEXT_VALIDATION_DELAY to do the validation in case there is continous keystroke.
if (isValidVCSApplicationIdOrSecret(props.config.applicationId)) {
@@ -177,7 +183,9 @@ export default {
const changeSecret = (value: string) => {
props.config.secret = value;
- clearInterval(state.secretValidationTimer);
+ if (state.secretValidationTimer) {
+ clearInterval(state.secretValidationTimer);
+ }
// If text becomes valid, we immediately clear the error.
// otherwise, we delay TEXT_VALIDATION_DELAY to do the validation in case there is continous keystroke.
if (isValidVCSApplicationIdOrSecret(props.config.secret)) {
diff --git a/frontend/src/views/IssueDetail.vue b/frontend/src/views/IssueDetail.vue
index a513e29bbf..8b0d8b251b 100644
--- a/frontend/src/views/IssueDetail.vue
+++ b/frontend/src/views/IssueDetail.vue
@@ -402,7 +402,9 @@ export default {
// pollIssue invalidates the current timer and schedule a new timer in <<interval>> microseconds
const pollIssue = (interval: number) => {
- clearInterval(state.pollIssueTimer);
+ if (state.pollIssueTimer) {
+ clearInterval(state.pollIssueTimer);
+ }
state.pollIssueTimer = setTimeout(() => {
store.dispatch("issue/fetchIssueById", idFromSlug(props.issueSlug));
@@ -422,7 +424,9 @@ export default {
});
onUnmounted(() => {
- clearInterval(state.pollIssueTimer);
+ if (state.pollIssueTimer) {
+ clearInterval(state.pollIssueTimer);
+ }
});
watch(