Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions front_end/entrypoints/inspector_main/InspectorMain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,25 @@ Common.Runnable.registerEarlyInitializationRunnable(InspectorMainImpl.instance);

export class ReloadActionDelegate implements UI.ActionRegistration.ActionDelegate {
handleAction(_context: UI.Context.Context, actionId: string): boolean {
const isReactNative = Root.Runtime.experiments.isEnabled(
Root.Runtime.ExperimentName.REACT_NATIVE_SPECIFIC_UI,
);

// [RN] Fork reload handling. React Native targets do not initialize
// ResourceTreeModel (Capability.DOM), and there is no hard reload concept.
if (isReactNative) {
switch (actionId) {
case 'inspector-main.reload':
case 'inspector-main.hard-reload':
const mainTarget = SDK.TargetManager.TargetManager.instance().primaryPageTarget();
if (!mainTarget) {
return false;
}
void mainTarget.pageAgent().invoke_reload({ignoreCache: true});
return true;
}
}

switch (actionId) {
case 'inspector-main.reload':
SDK.ResourceTreeModel.ResourceTreeModel.reloadAllPages(false);
Expand Down
3 changes: 2 additions & 1 deletion front_end/panels/react_devtools/ReactDevToolsModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ export class ReactDevToolsModel extends SDK.SDKModel.SDKModel<EventTypes> {
}

#handleReloadAppForProfiling(): void {
SDK.ResourceTreeModel.ResourceTreeModel.reloadAllPages(false);
const mainTarget = SDK.TargetManager.TargetManager.instance().primaryPageTarget();
void mainTarget?.pageAgent().invoke_reload({ignoreCache: true});
}

#handleBackendExecutionContextUnavailable({data: errorMessage}: ReactDevToolsBindingsBackendExecutionContextUnavailableEvent): void {
Expand Down
Loading