Merge branch 'master' of https://git.loafle.net/ucap-web/next-ucap-messenger
This commit is contained in:
commit
52bd202c6a
@ -600,12 +600,21 @@ ipcMain.on(
|
|||||||
ipcMain.on(
|
ipcMain.on(
|
||||||
FileChannel.SelectSaveFilePath,
|
FileChannel.SelectSaveFilePath,
|
||||||
(event: IpcMainEvent, ...args: any[]) => {
|
(event: IpcMainEvent, ...args: any[]) => {
|
||||||
|
const defaultPath = args[0];
|
||||||
|
const ext = path.extname(defaultPath);
|
||||||
dialog
|
dialog
|
||||||
.showSaveDialog({ defaultPath: args[0] })
|
.showSaveDialog({
|
||||||
|
defaultPath
|
||||||
|
})
|
||||||
.then(obj => {
|
.then(obj => {
|
||||||
|
const filePath =
|
||||||
|
'' !== ext && '' === path.extname(obj.filePath)
|
||||||
|
? `${obj.filePath}${ext}`
|
||||||
|
: obj.filePath;
|
||||||
|
|
||||||
event.returnValue = {
|
event.returnValue = {
|
||||||
canceled: obj.canceled,
|
canceled: obj.canceled,
|
||||||
filePath: obj.filePath
|
filePath
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
.catch(obj => {
|
.catch(obj => {
|
||||||
|
@ -918,19 +918,20 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
|
|||||||
this.nativeService
|
this.nativeService
|
||||||
.selectSaveFilePath(value.fileInfo.fileName)
|
.selectSaveFilePath(value.fileInfo.fileName)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
if (!!result && result.filePath.length > 0) {
|
if (!result) {
|
||||||
this.saveFile(value, result.filePath);
|
return;
|
||||||
} else {
|
|
||||||
if (!!result && result.canceled) {
|
|
||||||
// ignore..
|
|
||||||
} else {
|
|
||||||
this.snackBarService.open(
|
|
||||||
this.translateService.instant(
|
|
||||||
'common.file.errors.failToSpecifyPath'
|
|
||||||
),
|
|
||||||
this.translateService.instant('common.file.errors.label')
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (result.canceled) {
|
||||||
|
this.snackBarService.open(
|
||||||
|
this.translateService.instant('common.file.results.canceled'),
|
||||||
|
this.translateService.instant('common.file.errors.label'),
|
||||||
|
{
|
||||||
|
duration: 1000
|
||||||
|
}
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
this.saveFile(value, result.filePath);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(reason => {
|
.catch(reason => {
|
||||||
|
@ -408,6 +408,7 @@
|
|||||||
"saved": "The file has been saved.",
|
"saved": "The file has been saved.",
|
||||||
"savedAll": "All file(s) have(has) been saved.",
|
"savedAll": "All file(s) have(has) been saved.",
|
||||||
"savedToPath": "The file has been saved to path[{{path}}].",
|
"savedToPath": "The file has been saved to path[{{path}}].",
|
||||||
|
"canceled": "Canceled",
|
||||||
"downloadInProgress": "Download is in progress."
|
"downloadInProgress": "Download is in progress."
|
||||||
},
|
},
|
||||||
"errors": {
|
"errors": {
|
||||||
|
@ -408,6 +408,7 @@
|
|||||||
"saved": "파일이 저장되었습니다.",
|
"saved": "파일이 저장되었습니다.",
|
||||||
"savedAll": "모든 파일이 저장되었습니다.",
|
"savedAll": "모든 파일이 저장되었습니다.",
|
||||||
"savedToPath": "파일이 경로[{{path}}]에 저장되었습니다.",
|
"savedToPath": "파일이 경로[{{path}}]에 저장되었습니다.",
|
||||||
|
"canceled": "취소 되었습니다.",
|
||||||
"downloadInProgress": "다운로드가 진행중입니다."
|
"downloadInProgress": "다운로드가 진행중입니다."
|
||||||
},
|
},
|
||||||
"errors": {
|
"errors": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user