From 9ef9d8fce38fa430d0fd9a3ca03e940419b26645 Mon Sep 17 00:00:00 2001 From: apple502j <33279053+apple502j@users.noreply.github.com> Date: Fri, 13 Sep 2019 22:29:21 +0900 Subject: [PATCH] Check extension before setting title --- src/main/index.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/index.js b/src/main/index.js index 949c9aa..8ba7f3c 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -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();