mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-02-15 07:28:59 +00:00
Fix button label for save dialog
This commit is contained in:
@@ -8414,6 +8414,10 @@
|
||||
"messageformat": "Don't share personal information with people you don't know",
|
||||
"description": "Third list item in profile name warning modal for group conversations"
|
||||
},
|
||||
"icu:SaveMultiDialog__title": {
|
||||
"messageformat": "Save attachments",
|
||||
"description": "Title of the dialog to save multiple attachments"
|
||||
},
|
||||
"icu:WhatsNew__modal-title": {
|
||||
"messageformat": "What's New",
|
||||
"description": "Title for the whats new modal"
|
||||
|
||||
14
app/main.ts
14
app/main.ts
@@ -3122,7 +3122,15 @@ ipc.handle(
|
||||
'show-open-folder-dialog',
|
||||
async (
|
||||
_event,
|
||||
{ useMainWindow }: { useMainWindow: boolean } = { useMainWindow: false }
|
||||
{
|
||||
useMainWindow,
|
||||
buttonLabel,
|
||||
title,
|
||||
}: {
|
||||
useMainWindow: boolean;
|
||||
buttonLabel?: string;
|
||||
title?: string;
|
||||
} = { useMainWindow: false }
|
||||
) => {
|
||||
let canceled: boolean;
|
||||
let selectedDirPaths: ReadonlyArray<string>;
|
||||
@@ -3138,12 +3146,16 @@ ipc.handle(
|
||||
{
|
||||
defaultPath: app.getPath('downloads'),
|
||||
properties: ['openDirectory', 'createDirectory'],
|
||||
buttonLabel,
|
||||
title,
|
||||
}
|
||||
));
|
||||
} else {
|
||||
({ canceled, filePaths: selectedDirPaths } = await dialog.showOpenDialog({
|
||||
defaultPath: app.getPath('downloads'),
|
||||
properties: ['openDirectory', 'createDirectory'],
|
||||
buttonLabel,
|
||||
title,
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ import { drop } from '../../util/drop';
|
||||
import type { DurationInSeconds } from '../../util/durations';
|
||||
import * as universalExpireTimer from '../../util/universalExpireTimer';
|
||||
import * as Attachment from '../../types/Attachment';
|
||||
import type { LocalizerType } from '../../types/I18N';
|
||||
import { AttachmentDownloadUrgency } from '../../types/AttachmentDownload';
|
||||
import { isFileDangerous } from '../../util/isFileDangerous';
|
||||
import { getLocalAttachmentUrl } from '../../util/getLocalAttachmentUrl';
|
||||
@@ -4121,11 +4122,17 @@ function saveAttachment(
|
||||
};
|
||||
}
|
||||
|
||||
const showSaveMultiDialog = (): Promise<{
|
||||
const showSaveMultiDialog = (
|
||||
i18n: LocalizerType
|
||||
): Promise<{
|
||||
canceled: boolean;
|
||||
dirPath?: string;
|
||||
}> => {
|
||||
return ipcRenderer.invoke('show-open-folder-dialog', { useMainWindow: true });
|
||||
return ipcRenderer.invoke('show-open-folder-dialog', {
|
||||
useMainWindow: true,
|
||||
title: i18n('icu:SaveMultiDialog__title'),
|
||||
buttonLabel: i18n('icu:save'),
|
||||
});
|
||||
};
|
||||
|
||||
export type SaveAttachmentsActionCreatorType = ReadonlyDeep<
|
||||
@@ -4140,7 +4147,7 @@ function saveAttachments(
|
||||
attachments: ReadonlyArray<AttachmentType>,
|
||||
timestamp = Date.now()
|
||||
): ThunkAction<void, RootStateType, unknown, ShowToastActionType> {
|
||||
return async dispatch => {
|
||||
return async (dispatch, getState) => {
|
||||
// check if any of the attachments could be dangerous
|
||||
for (const attachment of attachments) {
|
||||
const { fileName = '' } = attachment;
|
||||
@@ -4157,7 +4164,9 @@ function saveAttachments(
|
||||
}
|
||||
}
|
||||
|
||||
const { canceled, dirPath } = await showSaveMultiDialog();
|
||||
const { canceled, dirPath } = await showSaveMultiDialog(
|
||||
getIntl(getState())
|
||||
);
|
||||
if (canceled || !dirPath) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user