Skip to content

Commit e15c511

Browse files
committed
fix(mobile): show attachment and thread paste warnings together
1 parent ab2c9e2 commit e15c511

1 file changed

Lines changed: 15 additions & 8 deletions

File tree

‎apps/mobile/src/components/ComposerEditor.tsx‎

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,22 @@ export function ComposerEditor({
114114
);
115115
return;
116116
}
117-
if (result.failures.length > 0)
117+
const warnings = [
118+
...(result.failures.length > 0
119+
? [
120+
"Some attachments could not be copied. Reconnect to the source environment and copy them again.",
121+
]
122+
: []),
123+
...(result.skippedThreads.length > 0
124+
? [
125+
`Threads from another machine weren't pasted: this machine's agent can't read ${result.skippedThreads.map((title) => `"${title}"`).join(", ")}.`,
126+
]
127+
: []),
128+
];
129+
if (warnings.length > 0)
118130
Alert.alert(
119-
"Some attachments could not be copied",
120-
"Reconnect to the source environment and copy them again. References without their files are marked unavailable.",
121-
);
122-
else if (result.skippedThreads.length > 0)
123-
Alert.alert(
124-
"Threads from another machine weren't pasted",
125-
`This machine's agent can't read ${result.skippedThreads.map((title) => `"${title}"`).join(", ")}, so the references are marked unavailable.`,
131+
"Some context could not be pasted",
132+
[...warnings, "Those references are marked unavailable."].join("\n\n"),
126133
);
127134
} catch (error) {
128135
if (!controller.signal.aborted)

0 commit comments

Comments
 (0)