MCPcopy Create free account
hub / github.com/DTStack/molecule / initView

Method initView

src/controller/notification.tsx:75–106  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

73 };
74
75 public initView() {
76 const {
77 builtInNotification,
78 NOTIFICATION_CLEAR_ALL,
79 NOTIFICATION_HIDE,
80 } = this.builtinService.getModules();
81
82 if (builtInNotification) {
83 const NotificationView = connect(
84 this.notificationService,
85 NotificationStatusBarView
86 );
87 /* istanbul ignore next */
88 const defaultNotification = {
89 ...builtInNotification,
90 actionBar: [NOTIFICATION_CLEAR_ALL, NOTIFICATION_HIDE].filter(
91 Boolean
92 ) as IActionBarItemProps[],
93 render: () => (
94 <NotificationView
95 onClick={this.onClick}
96 onActionBarClick={this.onActionBarClick}
97 onCloseNotification={this.onCloseNotification}
98 />
99 ),
100 };
101 this.notificationService.setState({
102 ...defaultNotification,
103 });
104 this.statusBarService.add(defaultNotification, Float.right);
105 }
106 }
107}

Callers

nothing calls this directly

Calls 4

connectFunction · 0.90
setStateMethod · 0.80
getModulesMethod · 0.65
addMethod · 0.65

Tested by

no test coverage detected