diff --git a/Signum.React/Scripts/Navigator.tsx b/Signum.React/Scripts/Navigator.tsx index 26c53a1b8f..7c0112cd02 100644 --- a/Signum.React/Scripts/Navigator.tsx +++ b/Signum.React/Scripts/Navigator.tsx @@ -645,16 +645,17 @@ export function createInNewTab(pack: EntityPack) { var win = window.open(url); } -export function createNavigateOrTab(pack: EntityPack, event: React.MouseEvent) { +export function createNavigateOrTab(pack: EntityPack, event: React.MouseEvent) : Promise { if (!pack || !pack.entity) - return; + return Promise.resolve(); const es = getSettings(pack.entity.Type); if (es && es.avoidPopup || event.ctrlKey || event.button == 1) { createInNewTab(pack); + return Promise.resolve(); } else { - navigate(pack); + return navigate(pack); } } diff --git a/Signum.React/Scripts/Operations/ContextualOperations.tsx b/Signum.React/Scripts/Operations/ContextualOperations.tsx index 554890e68b..7e20761877 100644 --- a/Signum.React/Scripts/Operations/ContextualOperations.tsx +++ b/Signum.React/Scripts/Operations/ContextualOperations.tsx @@ -63,7 +63,9 @@ function defaultConstructFromMany(coc: ContextualOperationContext, ...ar return; API.constructFromMany(coc.context.lites, coc.operationInfo.key, ...args).then(pack => { - Navigator.createNavigateOrTab(pack, coc.event!); + Navigator.createNavigateOrTab(pack, coc.event!) + .then(() => coc.context.markRows({})) + .done(); }).done(); }).done(); @@ -243,8 +245,9 @@ export function defaultContextualClick(coc: ContextualOperationContext, ... API.constructFromLite(coc.context.lites[0], coc.operationInfo.key, ...args) .then(coc.onConstructFromSuccess || (pack => { notifySuccess(); - coc.context.markRows({}); - Navigator.createNavigateOrTab(pack, coc.event!); + Navigator.createNavigateOrTab(pack, coc.event!) + .then(() => coc.context.markRows({})) + .done(); })) .done(); } else {