fix: fix a bug makes log filter not working #63

This commit is contained in:
Kuingsmile
2025-07-21 17:51:27 +08:00
parent 77f9f81dea
commit 99c426c15c

View File

@@ -43,13 +43,13 @@ const showNotification = ref(false)
const notificationMessage = ref('')
const notificationType = ref<'success' | 'info' | 'warning' | 'error'>('success')
watch(
filterSource,
newValue => {
localStorage.setItem('logFilterSource', newValue)
},
{ immediate: true }
)
watch(filterSource, async newValue => {
localStorage.setItem('logFilterSource', newValue)
await appStore.loadLogs(
(newValue !== 'all' && newValue !== 'gin' ? newValue : 'openlist') as 'openlist' | 'rclone' | 'app'
)
await scrollToBottom()
})
let logRefreshInterval: NodeJS.Timeout | null = null
@@ -273,7 +273,12 @@ const togglePause = () => {
}
const refreshLogs = async () => {
await appStore.loadLogs()
await appStore.loadLogs(
(filterSource.value !== 'all' && filterSource.value !== 'gin' ? filterSource.value : 'openlist') as
| 'openlist'
| 'rclone'
| 'app'
)
await scrollToBottom()
if (isPaused.value) {
isPaused.value = false