@@ -80,6 +80,10 @@ export class ReactDevToolsModel extends SDK.SDKModel.SDKModel<EventTypes> {
80
80
window . addEventListener ( 'beforeunload' , ( ) => this . #bridge?. shutdown ( ) ) ;
81
81
}
82
82
83
+ override dispose ( ) : void {
84
+ this . #bridge?. removeListener ( 'reloadAppForProfiling' , this . #handleReloadAppForProfiling) ;
85
+ }
86
+
83
87
ensureInitialized ( ) : void {
84
88
if ( this . #initializeCalled) {
85
89
return ;
@@ -163,10 +167,21 @@ export class ReactDevToolsModel extends SDK.SDKModel.SDKModel<EventTypes> {
163
167
164
168
#finishInitializationAndNotify( ) : void {
165
169
this . #bridge = ReactDevTools . createBridge ( this . #wall) ;
166
- this . #store = ReactDevTools . createStore ( this . #bridge) ;
170
+ this . #store = ReactDevTools . createStore ( this . #bridge, {
171
+ supportsReloadAndProfile : true ,
172
+ } ) ;
173
+ this . #attachReloadToProfileListener( ) ;
167
174
this . dispatchEventToListeners ( Events . InitializationCompleted ) ;
168
175
}
169
176
177
+ #attachReloadToProfileListener( ) : void {
178
+ this . #bridge?. addListener ( 'reloadAppForProfiling' , this . #handleReloadAppForProfiling) ;
179
+ }
180
+
181
+ #handleReloadAppForProfiling( ) : void {
182
+ SDK . ResourceTreeModel . ResourceTreeModel . reloadAllPages ( false ) ;
183
+ }
184
+
170
185
#handleBackendExecutionContextUnavailable( { data : errorMessage } : ReactDevToolsBindingsBackendExecutionContextUnavailableEvent ) : void {
171
186
this . dispatchEventToListeners ( Events . InitializationFailed , errorMessage ) ;
172
187
}
0 commit comments