Merge pull request #38432 from KerollesFathy/confirm-before-logout
fix(ux): add confirm before logout
This commit is contained in:
commit
2aa234f907
1 changed files with 10 additions and 8 deletions
|
|
@ -380,15 +380,17 @@ frappe.Application = class Application {
|
|||
logout() {
|
||||
var me = this;
|
||||
me.logged_out = true;
|
||||
return frappe.call({
|
||||
method: "logout",
|
||||
callback: function (r) {
|
||||
if (r.exc) {
|
||||
return;
|
||||
}
|
||||
frappe.confirm(__("Are you sure you want to log out?"), function () {
|
||||
return frappe.call({
|
||||
method: "logout",
|
||||
callback: function (r) {
|
||||
if (r.exc) {
|
||||
return;
|
||||
}
|
||||
|
||||
me.redirect_to_login();
|
||||
},
|
||||
me.redirect_to_login();
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
handle_session_expired() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue