mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-20 02:08:57 +00:00
[signalapp/Signal-Desktop#7496] Respect user-entered file extension when saving
Co-authored-by: Teledar <lmartin1920@outlook.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user