mirror of
https://github.com/scratchfoundation/scratch-desktop.git
synced 2024-12-23 06:02:30 -05:00
Check extension before setting title
This commit is contained in:
parent
9ec118ea48
commit
9ef9d8fce3
1 changed files with 8 additions and 6 deletions
|
@ -94,6 +94,7 @@ const createMainWindow = () => {
|
|||
const userChosenPath = dialog.showSaveDialog(window, options);
|
||||
if (userChosenPath) {
|
||||
item.setSavePath(userChosenPath);
|
||||
if (extNameNoDot.toUpperCase() == "SB3") { // when a project is downloaded, not an asset
|
||||
const newProjectTitle = path.basename(userChosenPath, extName);
|
||||
webContents.send('setTitleFromSave', {title: newProjectTitle});
|
||||
|
||||
|
@ -101,6 +102,7 @@ const createMainWindow = () => {
|
|||
// using the old title. This call lets the telemetry client know that the save was actually completed
|
||||
// and the event should be committed to the event queue with this new title.
|
||||
telemetry.projectSaveCompleted(newProjectTitle);
|
||||
}
|
||||
} else {
|
||||
item.cancel();
|
||||
telemetry.projectSaveCanceled();
|
||||
|
|
Loading…
Reference in a new issue