Skip to content

Commit 3dbf039

Browse files
committed
fix(mobile): dev pairing link no longer opens Home inside a sheet
The development auto-connect path always replaced the pairing sheet with Home, even when it opened above another sheet. The workspace stack groups that pushed Home into the sheet below, so the thread list rendered inside Settings and Settings could not be reopened. Close the sheet the same way manual pairing does: go back when there is history, and replace with Home only on a cold start.
1 parent e74f477 commit 3dbf039

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

‎apps/mobile/src/features/connection/ConnectionsNewRouteScreen.tsx‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ export function ConnectionsNewRouteScreen({
158158
);
159159

160160
const connectAndClose = useCallback(
161-
async (pairingUrl: string, replaceWithHome: boolean) => {
161+
async (pairingUrl: string) => {
162162
setIsSubmitting(true);
163163
onChangeConnectionPairingUrl(pairingUrl);
164164
try {
@@ -169,7 +169,9 @@ export function ConnectionsNewRouteScreen({
169169
: Haptics.NotificationFeedbackType.Error,
170170
);
171171
if (AsyncResult.isSuccess(result)) {
172-
if (replaceWithHome || !navigation.canGoBack()) {
172+
// Return to whatever opened the sheet. Replacing it with Home would
173+
// nest Home inside any sheet still below it.
174+
if (!navigation.canGoBack()) {
173175
navigation.dispatch(StackActions.replace("Home"));
174176
} else {
175177
navigation.goBack();
@@ -183,7 +185,7 @@ export function ConnectionsNewRouteScreen({
183185
);
184186

185187
const handleSubmit = useCallback(async () => {
186-
await connectAndClose(buildPairingUrl(hostInput, codeInput), false);
188+
await connectAndClose(buildPairingUrl(hostInput, codeInput));
187189
}, [codeInput, connectAndClose, hostInput]);
188190

189191
useEffect(() => {
@@ -192,7 +194,7 @@ export function ConnectionsNewRouteScreen({
192194
}
193195

194196
attemptedAutoConnectRef.current = routePairingUrl;
195-
void connectAndClose(routePairingUrl, true);
197+
void connectAndClose(routePairingUrl);
196198
}, [connectAndClose, routePairingUrl, shouldAutoConnect]);
197199

198200
return (

0 commit comments

Comments
 (0)