state provider: drop confirm-query when going back over initial history

eslint complains about the window.confirm call, and neither I nor
some other colleagues here did see that dialogue ever in practice.

The confirm here does not adds any real value, as all other back
navigation are unprotected, but have similar potential in loosing
state.

One can always navigate forward via their user agent and for console
(noVNC, xterm.js) we have now a separate check.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht
2021-05-17 16:40:54 +02:00
parent 0199b09144
commit 265f10ddac

View File

@ -183,13 +183,7 @@ Ext.define('PVE.StateProvider', {
var history_change_cb = function(token) {
//console.log("HC " + token);
if (!token) {
var res = window.confirm(gettext('Are you sure you want to navigate away from this page?'));
if (res) {
// process text value and close...
Ext.History.back();
} else {
Ext.History.forward();
}
Ext.History.back();
return;
}