# 이슈처리
192 다른 이름으로 저장 취소시 팝업 문의건
This commit is contained in:
parent
81c8a2b790
commit
4e6332dccf
|
@ -603,7 +603,10 @@ ipcMain.on(
|
|||
dialog
|
||||
.showSaveDialog({ defaultPath: args[0] })
|
||||
.then(obj => {
|
||||
event.returnValue = obj.filePath;
|
||||
event.returnValue = {
|
||||
canceled: obj.canceled,
|
||||
filePath: obj.filePath
|
||||
};
|
||||
})
|
||||
.catch(obj => {
|
||||
event.returnValue = undefined;
|
||||
|
|
|
@ -918,15 +918,19 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
|
|||
this.nativeService
|
||||
.selectSaveFilePath(value.fileInfo.fileName)
|
||||
.then(result => {
|
||||
if (!!result && result.length > 0) {
|
||||
this.saveFile(value, result);
|
||||
if (!!result && result.filePath.length > 0) {
|
||||
this.saveFile(value, result.filePath);
|
||||
} else {
|
||||
this.snackBarService.open(
|
||||
this.translateService.instant(
|
||||
'common.file.errors.failToSpecifyPath'
|
||||
),
|
||||
this.translateService.instant('common.file.errors.label')
|
||||
);
|
||||
if (!!result && result.canceled) {
|
||||
// ignore..
|
||||
} else {
|
||||
this.snackBarService.open(
|
||||
this.translateService.instant(
|
||||
'common.file.errors.failToSpecifyPath'
|
||||
),
|
||||
this.translateService.instant('common.file.errors.label')
|
||||
);
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch(reason => {
|
||||
|
|
|
@ -187,9 +187,18 @@ export class BrowserNativeService extends NativeService {
|
|||
});
|
||||
}
|
||||
|
||||
selectSaveFilePath(defaultPath?: string): Promise<string> {
|
||||
return new Promise<string>((resolve, reject) => {
|
||||
resolve('');
|
||||
selectSaveFilePath(defaultPath?: string): Promise<{
|
||||
canceled: boolean,
|
||||
filePath: string
|
||||
}> {
|
||||
return new Promise<{
|
||||
canceled: boolean,
|
||||
filePath: string
|
||||
}>((resolve, reject) => {
|
||||
resolve({
|
||||
canceled: false,
|
||||
filePath: ''
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -309,8 +309,14 @@ export class ElectronNativeService implements NativeService {
|
|||
});
|
||||
}
|
||||
|
||||
selectSaveFilePath(defaultPath?: string): Promise<string> {
|
||||
return new Promise<string>((resolve, reject) => {
|
||||
selectSaveFilePath(defaultPath?: string): Promise<{
|
||||
canceled: boolean,
|
||||
filePath: string
|
||||
}> {
|
||||
return new Promise<{
|
||||
canceled: boolean,
|
||||
filePath: string
|
||||
}>((resolve, reject) => {
|
||||
try {
|
||||
resolve(
|
||||
this.ipcRenderer.sendSync(FileChannel.SelectSaveFilePath, defaultPath)
|
||||
|
|
|
@ -59,7 +59,10 @@ export abstract class NativeService {
|
|||
abstract openTargetItem(filePath?: string): Promise<boolean>;
|
||||
abstract getPath(name: NativePathName): Promise<string>;
|
||||
abstract selectDirectory(): Promise<string>;
|
||||
abstract selectSaveFilePath(defaultPath?: string): Promise<string>;
|
||||
abstract selectSaveFilePath(defaultPath?: string): Promise<{
|
||||
canceled: boolean,
|
||||
filePath: string
|
||||
}>;
|
||||
|
||||
abstract executeProcess(executableName: string): Promise<number>;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user