mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-07-07 04:53:25 -05:00
Resolved the intermittent issue with macros not displaying in the macros dialog.
This commit is contained in:
parent
b1f70b02ff
commit
16b9b103a2
|
@ -150,20 +150,12 @@ export default function MacrosDialog({onClose, onSave}) {
|
|||
try {
|
||||
// Fetch user macros data
|
||||
let { data: userMacroRespData } = await queryToolCtx.api.get(url_for('sqleditor.get_user_macros'));
|
||||
setUserMacrosData(userMacroRespData);
|
||||
|
||||
} catch (error) {
|
||||
setMacrosErr(error);
|
||||
}
|
||||
}, []);
|
||||
|
||||
|
||||
React.useEffect(async ()=>{
|
||||
try {
|
||||
// Fetch macros data
|
||||
let {data: respData} = await queryToolCtx.api.get(url_for('sqleditor.get_macros', {
|
||||
'trans_id': queryToolCtx.params.trans_id,
|
||||
}));
|
||||
|
||||
setUserMacrosData(userMacroRespData);
|
||||
/* Copying id to mid to track key id changes */
|
||||
setMacrosData(respData.macro.map((m)=>({...m, mid: m.id})));
|
||||
|
||||
|
@ -172,7 +164,6 @@ export default function MacrosDialog({onClose, onSave}) {
|
|||
}
|
||||
}, []);
|
||||
|
||||
|
||||
const onSaveClick = (_isNew, changeData)=>{
|
||||
return new Promise((resolve, reject)=>{
|
||||
const setMacros = async ()=>{
|
||||
|
|
Loading…
Reference in New Issue
Block a user