mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed an issue where a popup for unsaved changes appears when clicking on the
open file button for a blank query editor. Fixes #7376
This commit is contained in:
parent
cb05d2924f
commit
fbe7b56054
@ -19,5 +19,6 @@ Bug fixes
|
||||
*********
|
||||
|
||||
| `Issue #7372 <https://redmine.postgresql.org/issues/7372>`_ - Tell Docker to always pull the latest base images when building containers.
|
||||
| `Issue #7376 <https://redmine.postgresql.org/issues/7376>`_ - Fixed an issue where a popup for unsaved changes appears when clicking on the open file button for a blank query editor.
|
||||
| `Issue #7383 <https://redmine.postgresql.org/issues/7383>`_ - Fixed an issue where Preferences are not saved when the dialog is maximized.
|
||||
| `Issue #7388 <https://redmine.postgresql.org/issues/7388>`_ - Fixed an issue where an error message fills the entire window if the query is long.
|
||||
|
@ -214,8 +214,8 @@ export function MainToolBar({containerRef, onFilterClick, onManageMacros}) {
|
||||
const openFile = useCallback(()=>{
|
||||
confirmDiscard(()=>{
|
||||
eventBus.fireEvent(QUERY_TOOL_EVENTS.TRIGGER_LOAD_FILE);
|
||||
});
|
||||
}, []);
|
||||
}, true);
|
||||
}, [buttonsDisabled['save']]);
|
||||
|
||||
const saveFile = useCallback((saveAs=false)=>{
|
||||
eventBus.fireEvent(QUERY_TOOL_EVENTS.TRIGGER_SAVE_FILE, saveAs);
|
||||
@ -344,7 +344,12 @@ export function MainToolBar({containerRef, onFilterClick, onManageMacros}) {
|
||||
let url = url_for('help.static', {'filename': queryToolCtx.params.is_query_tool ? 'query_tool.html' : 'editgrid.html'});
|
||||
window.open(url, 'pgadmin_help');
|
||||
};
|
||||
const confirmDiscard=(callback)=>{
|
||||
const confirmDiscard=(callback, checkSaved=false)=>{
|
||||
if(checkSaved && buttonsDisabled['save']) {
|
||||
/* No need to check */
|
||||
callback();
|
||||
return;
|
||||
}
|
||||
queryToolCtx.modal.confirm(
|
||||
gettext('Unsaved changes'),
|
||||
gettext('Are you sure you wish to discard the current changes?'),
|
||||
|
Loading…
Reference in New Issue
Block a user