feat:移除了弹窗,服务器添加sls
This commit is contained in:
commit
6a295f9a7a
4082 files changed
+1322534
No files matched your search
@@ -0,0 +1,27 @@
|
||||
import { useQuery } from '@tanstack/vue-query'
|
||||
import { computed, type MaybeRefOrGetter, toValue } from 'vue'
|
||||
|
||||
import { get_post_upgrade_notice } from '@/helpers/instance'
|
||||
|
||||
export function postUpgradeNoticeQueryKey(instanceId: string) {
|
||||
return ['post-upgrade-notice', instanceId] as const
|
||||
}
|
||||
|
||||
export function usePostUpgradeNotice(instanceId: MaybeRefOrGetter<string>) {
|
||||
return useQuery({
|
||||
queryKey: computed(() => postUpgradeNoticeQueryKey(toValue(instanceId))),
|
||||
queryFn: async () => {
|
||||
try {
|
||||
return await get_post_upgrade_notice(toValue(instanceId))
|
||||
} catch (error) {
|
||||
if (import.meta.env.DEV) {
|
||||
console.error('Failed to load post-upgrade notice', error)
|
||||
}
|
||||
throw error
|
||||
}
|
||||
},
|
||||
enabled: computed(() => toValue(instanceId).length > 0),
|
||||
staleTime: 0,
|
||||
refetchOnMount: 'always',
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user