Updated to the latest version of the Notistack library. #7501

This commit is contained in:
Pravesh Sharma
2024-07-01 11:26:45 +05:30
committed by GitHub
parent 6f8cde67a6
commit 4457a6a6a1
5 changed files with 21 additions and 20 deletions

View File

@@ -230,7 +230,7 @@ define('pgadmin.node.server', [
obj.generate_url(i, 'connect', d, true),
).then(({data: res})=> {
if (res.success == 1) {
pgAdmin.Browser.notifier.success(res.info, null);
pgAdmin.Browser.notifier.success(res.info);
d = t.itemData(i);
t.removeIcon(i);
d.connected = false;

View File

@@ -62,7 +62,7 @@ export default function BasePage({pageImage, title, children, messages}) {
const snackbar = useSnackbar();
useEffect(()=>{
messages?.forEach((m)=>{
snackbar.enqueueSnackbar(null, {
snackbar.enqueueSnackbar({
autoHideDuration: null,
content: (key)=>{
if(Array.isArray(m[0])) m[0] = m[0][0];

View File

@@ -77,11 +77,11 @@ class SnackbarNotifier {
notify(content, autoHideDuration) {
if (content) {
let options = {autoHideDuration, content:(key) => (
let options = {autoHideDuration, content:(key) => (
<FinalNotifyContent>{React.cloneElement(content, {onClose:()=>{this.snackbarObj.closeSnackbar(key);}})}</FinalNotifyContent>
)};
options.content.displayName = 'content';
this.snackbarObj.enqueueSnackbar(null, options);
this.snackbarObj.enqueueSnackbar(options);
}
}