Fixed blank screen issue while opening online help in new window. #5503

This commit is contained in:
Nikhil Mohite
2022-12-09 11:50:53 +05:30
committed by GitHub
parent cc0d467927
commit adfef8e2bb
2 changed files with 11 additions and 6 deletions

View File

@@ -10,6 +10,9 @@ import gettext from 'sources/gettext';
import pgAdmin from 'sources/pgadmin';
import { getBrowser } from '../../../static/js/utils';
import Menu, { MenuItem } from './new_menu';
import getApiInstance from '../../../static/js/api_instance';
import url_for from 'sources/url_for';
import Notifier from '../../../static/js/helpers/Notifier';
export let MainMenus = [
{ label: gettext('File'), name: 'file', id: 'mnu_file', index: 0, addSepratior: true },
@@ -64,7 +67,14 @@ export class MainMenuItemFactory {
options.callback(options);
} else {
if (options.url != '#') {
window.open(options.url);
let api = getApiInstance();
api(
url_for('tools.initialize')
).then(()=>{
window.open(options.url);
}).catch(()=>{
Notifier.error(gettext('Error in opening window'));
});
}
}
}}, (menu, item)=> {