Skip to content

Commit f58bffd

Browse files
add notifications for apps loading with sdk
1 parent e4324ef commit f58bffd

File tree

2 files changed

+22
-17
lines changed

2 files changed

+22
-17
lines changed

client/packages/lowcoder/src/appView/AppView.tsx

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { default as App } from "antd/es/app";
2+
import GlobalInstances from "components/GlobalInstances";
13
import { RootComp } from "comps/comps/rootComp";
24
import { GetContainerParams, useCompInstance } from "comps/utils/useCompInstance";
35
import { createBrowserHistory } from "history";
@@ -88,19 +90,22 @@ export function AppView(props: AppViewProps) {
8890
}, [moduleInputs]);
8991

9092
return (
91-
<Provider store={reduxStore}>
92-
<ExternalEditorContext.Provider
93-
value={{
94-
applicationId: appId,
95-
appType: 1,
96-
readOnly: true,
97-
hideHeader: true,
98-
}}
99-
>
100-
<Router history={browserHistory}>
101-
<Route path="/" render={() => comp?.getView()} />
102-
</Router>
103-
</ExternalEditorContext.Provider>
104-
</Provider>
93+
<App>
94+
<GlobalInstances />
95+
<Provider store={reduxStore}>
96+
<ExternalEditorContext.Provider
97+
value={{
98+
applicationId: appId,
99+
appType: 1,
100+
readOnly: true,
101+
hideHeader: true,
102+
}}
103+
>
104+
<Router history={browserHistory}>
105+
<Route path="/" render={() => comp?.getView()} />
106+
</Router>
107+
</ExternalEditorContext.Provider>
108+
</Provider>
109+
</App>
105110
);
106111
}

client/packages/lowcoder/src/comps/queries/queryComp/queryNotificationControl.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const SuccessMessageAction = new MultiCompBuilder(
2323
{
2424
text: StringControl,
2525
},
26-
(props) => (duration: number) => props.text && messageInstance.success(props.text, duration)
26+
(props) => (duration: number) => props.text && messageInstance?.success(props.text, duration)
2727
)
2828
.setPropertyViewFn((children) => (
2929
<>
@@ -109,14 +109,14 @@ const QueryNotificationTmpControl = new MultiCompBuilder(
109109
props.fail.forEach((item) => {
110110
const props = (item.getView() as any)({ data: result.data });
111111
if (props.condition && props.text) {
112-
messageInstance.error(props.text, duration);
112+
messageInstance?.error(props.text, duration);
113113
hasNoticed = true;
114114
}
115115
});
116116

117117
// Execute system notification if triggered manually without custom notification and query fails
118118
if (!result.success && !hasNoticed) {
119-
hasNoticed = !!messageInstance.error(
119+
hasNoticed = !!messageInstance?.error(
120120
trans("query.failMessageWithName", {
121121
name,
122122
result: JSON.stringify(pick(result, ["code", "message"])),

0 commit comments

Comments
 (0)