♻️ Fully typed API

This commit is contained in:
2025-09-19 01:21:38 +08:00
parent 7904ce9ca7
commit 60e8b1dcfb
13 changed files with 276 additions and 26 deletions

View File

@@ -47,13 +47,20 @@ import { useSolarNetwork } from '~/composables/useSolarNetwork'
import PubSelect from './PubSelect.vue'
// Interface for uploaded files in the editor
interface UploadedFile {
name: string
url: string
type: string
}
const emits = defineEmits(['posted'])
const publisher = ref<string | undefined>()
const content = ref('')
const selectedFiles = ref<File[]>([])
const fileList = ref<any[]>([])
const fileList = ref<UploadedFile[]>([])
const submitting = ref(false)
@@ -103,7 +110,7 @@ function uploadFile(file: File) {
onError: function (error) {
console.error('[DRIVE] Upload failed:', error)
},
onProgress: function (bytesUploaded, bytesTotal) {
onProgress: function (_bytesUploaded, _bytesTotal) {
// Could show progress
},
onSuccess: function (payload) {
@@ -122,7 +129,7 @@ function uploadFile(file: File) {
},
})
upload.findPreviousUploads().then(function (previousUploads) {
if (previousUploads.length) {
if (previousUploads.length > 0 && previousUploads[0]) {
upload.resumeFromPreviousUpload(previousUploads[0])
}
upload.start()