Browse Source

fix: continuous logs will be missed in Console component

master
smallstonesk 4 years ago
parent
commit
46a63808d6
  1. 4
      packages/core/src/components/console/index.tsx
  2. 1
      packages/core/src/mods/flowChart/codeEditorModel/index.tsx

4
packages/core/src/components/console/index.tsx

@ -88,7 +88,7 @@ const MyConsole: React.FC = () => {
return () => {
resetConsole();
};
}, [logList]);
}, []);
useEffect(() => {
const filteredLogs = cache.current.allLogs
@ -110,7 +110,7 @@ const MyConsole: React.FC = () => {
// @ts-ignore
window.console[method] = (...args: any[]) => {
hijackMap[method].originMethod(...args);
cache.current.allLogs = logList.concat({
cache.current.allLogs = cache.current.allLogs.concat({
type: method,
data: args,
strVal: Helper.getArgsToString(args)

1
packages/core/src/mods/flowChart/codeEditorModel/index.tsx

@ -87,6 +87,7 @@ const CodeEditModal: React.FC<IProps> = (props) => {
setVisible(false);
};
const onRunCode = (): void => {
updateNodeCode(code);
flowChart.trigger('graph:runCode');
};
const onChangeCode = (ev: any, newCode: string | undefined = ''): void => {

Loading…
Cancel
Save