Fixed an issue where notifier not working when opening query tool in a new

window and then open it in the new tab.
This commit is contained in:
Akshay Joshi
2021-12-08 18:15:13 +05:30
parent 91a288c2bb
commit f24348b2b0
3 changed files with 8 additions and 7 deletions
+4 -4
View File
@@ -132,7 +132,7 @@ var Notifier = {
notify(content, autoHideDuration) {
if (content) {
if(!notifierInitialized) {
initializeNotifier(document.getElementById('notifierContainer'));
initializeNotifier();
}
let options = {autoHideDuration, content:(key) => (
<FinalNotifyContent>{React.cloneElement(content, {onClose:()=>{snackbarRef.closeSnackbar(key);}})}</FinalNotifyContent>
@@ -221,7 +221,7 @@ var Notifier = {
},
alert: (title, text, okLabel=gettext('OK'), onOkClick)=>{
if(!modalInitialized) {
initializeModalProvider(document.getElementById('modalContainer'));
initializeModalProvider();
}
modalRef.showModal(title, (closeModal)=>{
const onOkClickClose = ()=>{
@@ -235,7 +235,7 @@ var Notifier = {
},
confirm: (title, text, onOkClick, onCancelClick, okLabel=gettext('Yes'), cancelLabel=gettext('No'))=>{
if(!modalInitialized) {
initializeModalProvider(document.getElementById('modalContainer'));
initializeModalProvider();
}
modalRef.showModal(title, (closeModal)=>{
const onCancelClickClose = ()=>{
@@ -255,7 +255,7 @@ var Notifier = {
if(window.frameElement) {
Notifier = pgWindow.Notifier || Notifier;
} else {
} else if(!pgWindow.Notifier){
pgWindow.Notifier = Notifier;
}
export default Notifier;