Skip to content

Commit 563e86a

Browse files
authored
add websocketDisconnectedPageRemoved (#285)
1 parent 3a2e387 commit 563e86a

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

‎front_end/ui/legacy/components/utils/TargetDetachedDialog.ts‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ const UIStrings = {
2525
/**
2626
*@description Text on the remote debugging window to indicate a disconnection happened because a second dev tools instance was opened
2727
*/
28-
websocketDisconnectedNewDebuggerOpened: 'Disconnected due to opening a second DevTools window for the same app.'
28+
websocketDisconnectedNewDebuggerOpened: 'Disconnected due to opening a second DevTools window for the same app.',
29+
/**
30+
*@description Text on the remote debugging window to indicate the React Native instance being debugged was destroyed
31+
*/
32+
websocketDisconnectedPageRemoved:
33+
'The React Native instance being debugged no longer exists. Relaunch DevTools to debug a new instance.',
2934
} as const;
3035

3136
const str_ = i18n.i18n.registerUIStrings('ui/legacy/components/utils/TargetDetachedDialog.ts', UIStrings);
@@ -64,6 +69,10 @@ export class TargetDetachedDialog extends SDK.SDKModel.SDKModel<void> implements
6469
return i18nString(UIStrings.websocketDisconnectedNewDebuggerOpened);
6570
}
6671

72+
if (connectionLostDetails.code === '1000' && connectionLostDetails.reason?.includes('[PAGE_REMOVED]')) {
73+
return i18nString(UIStrings.websocketDisconnectedPageRemoved);
74+
}
75+
6776
return null;
6877
}
6978

0 commit comments

Comments
 (0)