Fix file inspector route regressions
This commit is contained in:
1 parent
42a2275bbd
commit
bcf070aa2c
3 files changed
+6
-20
No files matched your search
@@ -116,7 +116,7 @@ export default function NewTaskRoute() {
|
||||
<Stack.Toolbar.Button
|
||||
accessibilityLabel="Close new task"
|
||||
icon="xmark"
|
||||
onPress={() => router.back()}
|
||||
onPress={() => router.dismiss()}
|
||||
separateBackground
|
||||
/>
|
||||
) : null}
|
||||
|
||||
@@ -650,15 +650,6 @@ export function ThreadFileScreen() {
|
||||
assetPreviewUri === null || previewRevision === 0
|
||||
? assetPreviewUri
|
||||
: `${assetPreviewUri}${assetPreviewUri.includes("?") ? "&" : "?"}revision=${previewRevision}`;
|
||||
const handleReturnToThread = useCallback(() => {
|
||||
if (router.canGoBack()) {
|
||||
router.back();
|
||||
return;
|
||||
}
|
||||
if (environmentId !== null && threadId !== null) {
|
||||
router.replace(buildThreadRoutePath({ environmentId, threadId }));
|
||||
}
|
||||
}, [environmentId, router, threadId]);
|
||||
const needsFileContents =
|
||||
relativePath !== null &&
|
||||
(resolvedActiveMode === "source" || isMarkdownPreviewFile(relativePath));
|
||||
@@ -699,15 +690,6 @@ export function ThreadFileScreen() {
|
||||
[cwd, environmentId, fileInspector.supported, handleSelectFile, projectName, relativePath],
|
||||
);
|
||||
|
||||
if (fileInspector.supported && environmentId !== null && threadId !== null) {
|
||||
return (
|
||||
<ThreadRouteScreen
|
||||
onReturnToThread={handleReturnToThread}
|
||||
renderInspector={renderInspector}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
if (selectedThread === null || environmentId === null || threadId === null) {
|
||||
return <LoadingScreen message="Opening file..." messagePlacement="above-spinner" />;
|
||||
}
|
||||
|
||||
@@ -537,7 +537,11 @@ export function ThreadNavigationSidebar(props: {
|
||||
style={styles.threadList}
|
||||
ListEmptyComponent={
|
||||
<Text className="px-2 py-4 text-sm" style={{ color: mutedColor }}>
|
||||
{searchQuery.trim().length > 0 ? "No matching threads" : "No threads yet"}
|
||||
{catalogState.isLoadingConnections
|
||||
? "Loading threads…"
|
||||
: searchQuery.trim().length > 0
|
||||
? "No matching threads"
|
||||
: "No threads yet"}
|
||||
</Text>
|
||||
}
|
||||
/>
|
||||
|
||||
Reference in new issue
Block a user