mirror of
https://github.com/modrinth/code.git
synced 2026-08-28 02:24:56 +00:00
fix: memory issues when importing giant mrpack files (#6278)
* feat: dont load mrpacks into memory if they are local imports * fix: frontend
This commit is contained in:
@@ -9,11 +9,21 @@ export interface PickedFile {
|
||||
previewUrl: string
|
||||
}
|
||||
|
||||
export interface PickedModpackFile extends Omit<PickedFile, 'file'> {
|
||||
/** Only present for upload flows; native imports avoid copying huge packs into the webview heap. */
|
||||
file?: File
|
||||
}
|
||||
|
||||
export interface PickModpackFileOptions {
|
||||
/** Set to false when a native path can be streamed directly by the backend. */
|
||||
readFile?: boolean
|
||||
}
|
||||
|
||||
export interface FilePickerProvider {
|
||||
/** Pick an image file (for icons) */
|
||||
pickImage: () => Promise<PickedFile | null>
|
||||
/** Pick a .mrpack modpack file */
|
||||
pickModpackFile: () => Promise<PickedFile | null>
|
||||
pickModpackFile: (options?: PickModpackFileOptions) => Promise<PickedModpackFile | null>
|
||||
}
|
||||
|
||||
export const [injectFilePicker, provideFilePicker] = createContext<FilePickerProvider>('FilePicker')
|
||||
|
||||
Reference in New Issue
Block a user