Skip to content

Commit

Permalink
fix: add default value for auto refresh interval #116
Browse files Browse the repository at this point in the history
  • Loading branch information
tiny-craft committed Jan 11, 2024
1 parent aab2531 commit 1a67569
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion frontend/src/components/common/IconButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const props = defineProps({
tTooltip: String,
tooltipDelay: {
type: Number,
default: 1000,
default: 800,
},
type: String,
icon: [String, Object],
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/components/content_value/ContentToolbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ const startAutoRefresh = async () => {
return
}
autoRefresh.on = true
if (!isNaN(autoRefresh.interval)) {
autoRefresh.interval = 2
}
autoRefresh.interval = Math.min(autoRefresh.interval, 1)
let lastExec = Date.now()
do {
if (!autoRefresh.on) {
Expand Down Expand Up @@ -167,6 +171,7 @@ const onTTL = () => {
<n-input-number
v-model:value="autoRefresh.interval"
:autofocus="false"
:default-value="2"
:disabled="autoRefresh.on"
:max="9999"
:min="1"
Expand Down

0 comments on commit 1a67569

Please sign in to comment.