mirror of
https://github.com/modrinth/code.git
synced 2026-08-25 17:14:50 +00:00
feat: make byte size units translatable (#5969)
Make byte size units translatable
This commit is contained in:
@@ -50,6 +50,7 @@ import { FolderUpIcon } from '@modrinth/assets'
|
||||
import { fileIsValid } from '@modrinth/utils'
|
||||
import { ref } from 'vue'
|
||||
|
||||
import { useFormatBytes } from '../../composables'
|
||||
import { injectNotificationManager } from '../../providers'
|
||||
|
||||
const { addNotification } = injectNotificationManager()
|
||||
@@ -78,6 +79,8 @@ const props = withDefaults(
|
||||
},
|
||||
)
|
||||
|
||||
const formatBytes = useFormatBytes()
|
||||
|
||||
const files = ref<File[]>([])
|
||||
|
||||
function matchesAccept(file: File, accept?: string): boolean {
|
||||
@@ -129,7 +132,7 @@ function addFiles(incoming: FileList, shouldNotReset = false) {
|
||||
alertOnInvalid: true,
|
||||
}
|
||||
|
||||
files.value = files.value.filter((file) => fileIsValid(file, validationOptions))
|
||||
files.value = files.value.filter((file) => fileIsValid(file, validationOptions, formatBytes))
|
||||
|
||||
if (files.value.length > 0) {
|
||||
emit('change', files.value)
|
||||
|
||||
Reference in New Issue
Block a user