feat: enhance cloud image management
This commit is contained in:
@@ -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) : [],
|
||||
|
||||
Reference in New Issue
Block a user