feat: enhance cloud image management

This commit is contained in:
2026-05-22 10:34:35 +08:00
parent 7cdf07447c
commit 7e4ee3d699
11 changed files with 1468 additions and 216 deletions
+3
View File
@@ -1,5 +1,6 @@
import { ref } from 'vue'
import { supabase } from '@/lib/supabase'
import { useProfileStore } from '@/stores/profile'
import type { CloudType } from '@/types/database'
export interface UploadItem {
@@ -214,6 +215,7 @@ async function fetchBadgeDetails(unlockedRows: Array<{ cloudTypeId: number; unlo
}
export function useUpload() {
const profileStore = useProfileStore()
const items = ref<UploadItem[]>([])
const uploading = ref(false)
const overallProgress = ref(0)
@@ -421,6 +423,7 @@ export function useUpload() {
URL.revokeObjectURL(item.preview)
}
items.value = []
profileStore.invalidateUser(userId)
return {
ok: true,
unlockedBadges: newlyUnlockedRows.length ? await fetchBadgeDetails(newlyUnlockedRows) : [],