[signalapp/Signal-Desktop#7496] Respect user-entered file extension when saving

Co-authored-by: Teledar <lmartin1920@outlook.com>
This commit is contained in:
Fedor Indutny
2025-09-25 12:28:29 -07:00
committed by GitHub
parent e3474f468f
commit 11498482a1

View File

@@ -3054,6 +3054,9 @@ ipc.handle('show-save-dialog', async (_event, { defaultPath }) => {
// On Windows, if you change the path from the default, the extension is
// removed. We want to make sure the extension is always there.
if (extname(selectedFilePath) !== '') {
return { canceled: false, filePath: selectedFilePath };
}
const defaultExt = extname(defaultPath);
const finalDirname = dirname(selectedFilePath);
const finalBasename = basename(selectedFilePath, defaultExt);