Revert "Added message asking if you want to save pending changes before exiting"
This reverts commit 71a3c494ae
.
This commit is contained in:
parent
71a3c494ae
commit
43a63a1ac7
|
@ -1,7 +1,7 @@
|
|||
import * as path from "path";
|
||||
import * as url from "url";
|
||||
|
||||
import { app, BrowserWindow, screen, ipcMain } from "electron";
|
||||
import { app, BrowserWindow, screen } from "electron";
|
||||
|
||||
import { LogService } from "@bitwarden/common/abstractions/log.service";
|
||||
import { StateService } from "@bitwarden/common/abstractions/state.service";
|
||||
|
@ -98,9 +98,6 @@ export class WindowMain {
|
|||
// throw e;
|
||||
reject(e);
|
||||
}
|
||||
ipcMain.on("request-app-quit", () => {
|
||||
app.quit();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import {
|
||||
ChangeDetectorRef,
|
||||
Component,
|
||||
HostListener,
|
||||
NgZone,
|
||||
OnDestroy,
|
||||
OnInit,
|
||||
|
@ -9,7 +8,6 @@ import {
|
|||
ViewContainerRef,
|
||||
} from "@angular/core";
|
||||
import { ActivatedRoute, Router } from "@angular/router";
|
||||
import { ipcRenderer } from "electron";
|
||||
import { first } from "rxjs/operators";
|
||||
|
||||
import { ModalRef } from "@bitwarden/angular/components/modal/modal.ref";
|
||||
|
@ -85,7 +83,6 @@ export class VaultComponent implements OnInit, OnDestroy {
|
|||
activeFilter: VaultFilter = new VaultFilter();
|
||||
|
||||
private modal: ModalRef = null;
|
||||
private triedQuit = false;
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
|
@ -633,7 +630,6 @@ export class VaultComponent implements OnInit, OnDestroy {
|
|||
this.addEditComponent.cipher.login.username = value;
|
||||
}
|
||||
}
|
||||
this.addEditComponent.submit();
|
||||
});
|
||||
|
||||
// eslint-disable-next-line rxjs-angular/prefer-takeuntil
|
||||
|
@ -776,32 +772,6 @@ export class VaultComponent implements OnInit, OnDestroy {
|
|||
return true;
|
||||
}
|
||||
|
||||
private async saveChangesOrCancel() {
|
||||
const result = await ipcRenderer.invoke("showMessageBox", {
|
||||
type: "warning",
|
||||
title: "Unsaved Changes",
|
||||
message: "Do you want to save your pending changes?",
|
||||
buttons: ["Yes", "No", "Cancel"],
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
@HostListener("window:beforeunload", ["$event"])
|
||||
private async onBeforeUnload(event: BeforeUnloadEvent) {
|
||||
if (!this.triedQuit && this.dirtyInput() && this.action == "edit") {
|
||||
event.returnValue = false;
|
||||
let response = await this.saveChangesOrCancel();
|
||||
response = response.response;
|
||||
if (response === 0 || response === 1) {
|
||||
if (response === 0) {
|
||||
await this.addEditComponent.submit();
|
||||
}
|
||||
this.triedQuit = true;
|
||||
ipcRenderer.send("request-app-quit");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async passwordReprompt(cipher: CipherView) {
|
||||
return (
|
||||
cipher.reprompt === CipherRepromptType.None ||
|
||||
|
|
Loading…
Reference in New Issue