2020-04-21 15:34:56 +00:00
|
|
|
export function selectDriveFolder($root: any, multiple) {
|
|
|
|
return new Promise((res, rej) => {
|
2020-04-22 10:36:28 +00:00
|
|
|
import('../components/drive-window.vue').then(m => m.default).then(dialog => {
|
|
|
|
const w = $root.new(dialog, {
|
|
|
|
type: 'folder',
|
|
|
|
multiple
|
|
|
|
});
|
|
|
|
w.$once('selected', folders => {
|
|
|
|
res(multiple ? folders : (folders.length === 0 ? null : folders[0]));
|
|
|
|
});
|
2020-04-21 15:34:56 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|