iceshrimp/src/client/scripts/select-drive-file.ts

14 lines
306 B
TypeScript
Raw Normal View History

import DriveWindow from '../components/drive-window.vue';
export function selectDriveFile($root: any, multiple) {
return new Promise((res, rej) => {
const w = $root.new(DriveWindow, {
type: 'file',
multiple
});
w.$once('selected', files => {
res(multiple ? files : files[0]);
});
});
}