mirror of
https://github.com/scratchfoundation/scratch-desktop.git
synced 2024-12-22 21:52:31 -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,13 +94,15 @@ const createMainWindow = () => {
|
|||
const userChosenPath = dialog.showSaveDialog(window, options);
|
||||
if (userChosenPath) {
|
||||
item.setSavePath(userChosenPath);
|
||||
const newProjectTitle = path.basename(userChosenPath, extName);
|
||||
webContents.send('setTitleFromSave', {title: newProjectTitle});
|
||||
if (extNameNoDot.toUpperCase() == "SB3") { // when a project is downloaded, not an asset
|
||||
const newProjectTitle = path.basename(userChosenPath, extName);
|
||||
webContents.send('setTitleFromSave', {title: newProjectTitle});
|
||||
|
||||
// "setTitleFromSave" will set the project title but GUI has already reported the telemetry event
|
||||
// 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);
|
||||
// "setTitleFromSave" will set the project title but GUI has already reported the telemetry event
|
||||
// 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