From a3f9c62f4e81269ba6fcb566eb8888f6bf8813b6 Mon Sep 17 00:00:00 2001 From: Lykin <137850705+tiny-craft@users.noreply.github.com> Date: Fri, 12 Jan 2024 14:49:01 +0800 Subject: [PATCH] fix: add default value for auto refresh interval #116 --- .../content_value/ContentToolbar.vue | 23 +++++-------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/frontend/src/components/content_value/ContentToolbar.vue b/frontend/src/components/content_value/ContentToolbar.vue index 2d6bc53..909dad3 100644 --- a/frontend/src/components/content_value/ContentToolbar.vue +++ b/frontend/src/components/content_value/ContentToolbar.vue @@ -11,7 +11,7 @@ import IconButton from '@/components/common/IconButton.vue' import Copy from '@/components/icons/Copy.vue' import { ClipboardSetText } from 'wailsjs/runtime/runtime.js' import { computed, onUnmounted, reactive, watch } from 'vue' -import { padStart } from 'lodash' +import { isNumber, padStart } from 'lodash' import { NIcon, useThemeVars } from 'naive-ui' import { timeout } from '@/utils/promise.js' @@ -74,10 +74,10 @@ const startAutoRefresh = async () => { return } autoRefresh.on = true - if (!isNaN(autoRefresh.interval)) { + if (!isNumber(autoRefresh.interval)) { autoRefresh.interval = 2 } - autoRefresh.interval = Math.min(autoRefresh.interval, 1) + autoRefresh.interval = Math.max(autoRefresh.interval, 1) let lastExec = Date.now() do { if (!autoRefresh.on) { @@ -147,11 +147,10 @@ const onTTL = () => { @@ -226,14 +225,4 @@ const onTTL = () => { align-items: center; gap: 5px; } - -.auto-refreshing { - animation: rotate 2s linear infinite; -} - -@keyframes rotate { - 100% { - transform: rotate(360deg); - } -}