Fix Save As

This commit is contained in:
Oystein Kristoffer Tveit 2021-04-26 11:30:56 +02:00
parent 075988f327
commit 94be84d6e1
2 changed files with 1 additions and 3 deletions

View File

@ -155,8 +155,6 @@ public class EditorController implements Initializable, Controller {
public void saveCodeArea(boolean isNewFile) { public void saveCodeArea(boolean isNewFile) {
Stage stage = (Stage) editor.getScene().getWindow(); Stage stage = (Stage) editor.getScene().getWindow();
isNewFile = Model.getActiveFilePath().isEmpty();
if (isNewFile && FileOperations.saveFileWithDialog(stage, editor.getText())) { if (isNewFile && FileOperations.saveFileWithDialog(stage, editor.getText())) {
this.eventBus.post(new OpenFileEvent(Model.getActiveFilePath())); this.eventBus.post(new OpenFileEvent(Model.getActiveFilePath()));
this.eventBus.post(new FileSaveStateChangedEvent(true)); this.eventBus.post(new FileSaveStateChangedEvent(true));

View File

@ -124,7 +124,7 @@ public class MenubarController implements Initializable, Controller {
*/ */
@FXML @FXML
private void handleSaveAsFile() { private void handleSaveAsFile() {
this.eventBus.post(new SaveFileEvent(false)); this.eventBus.post(new SaveFileEvent(true));
} }
/** /**