提交 d75b73b1 编写于 作者: I isidor

User canceled a download. In case there were multiple files selected we should...

User canceled a download. In case there were multiple files selected we should cancel the remainder of the prompts

fixes #86100
上级 af60c01f
...@@ -980,7 +980,12 @@ const downloadFileHandler = (accessor: ServicesAccessor) => { ...@@ -980,7 +980,12 @@ const downloadFileHandler = (accessor: ServicesAccessor) => {
const explorerService = accessor.get(IExplorerService); const explorerService = accessor.get(IExplorerService);
const stats = explorerService.getContext(true); const stats = explorerService.getContext(true);
let canceled = false;
stats.forEach(async s => { stats.forEach(async s => {
if (canceled) {
return;
}
if (isWeb) { if (isWeb) {
if (!s.isDirectory) { if (!s.isDirectory) {
triggerDownload(asDomUri(s.resource), s.name); triggerDownload(asDomUri(s.resource), s.name);
...@@ -999,6 +1004,9 @@ const downloadFileHandler = (accessor: ServicesAccessor) => { ...@@ -999,6 +1004,9 @@ const downloadFileHandler = (accessor: ServicesAccessor) => {
}); });
if (destination) { if (destination) {
await textFileService.copy(s.resource, destination); await textFileService.copy(s.resource, destination);
} else {
// User canceled a download. In case there were multiple files selected we should cancel the remainder of the prompts #86100
canceled = true;
} }
} }
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册