dev #3

Merged
lan merged 8 commits from dev into master 2026-03-19 01:00:14 +08:00
Showing only changes of commit a9c514f664 - Show all commits

View File

@@ -334,6 +334,9 @@ export const CreatePostScreen: React.FC<CreatePostScreenProps> = (props) => {
// 发布帖子
const handlePost = async () => {
// 防止重复点击
if (posting) return;
if (!content.trim()) {
Alert.alert('错误', '请输入帖子内容');
return;
@@ -373,7 +376,10 @@ export const CreatePostScreen: React.FC<CreatePostScreenProps> = (props) => {
message: '投票帖已提交,内容审核中,稍后展示',
duration: 2600,
});
navigation.goBack();
navigation.reset({
index: 0,
routes: [{ name: 'Main' }],
});
} else {
if (isEditMode && editPostID) {
const updated = await postService.updatePost(editPostID, {
@@ -390,7 +396,10 @@ export const CreatePostScreen: React.FC<CreatePostScreenProps> = (props) => {
message: '帖子内容已更新',
duration: 2200,
});
navigation.goBack();
navigation.reset({
index: 0,
routes: [{ name: 'Main' }],
});
} else {
// 创建普通帖子
await postService.createPost({
@@ -404,7 +413,10 @@ export const CreatePostScreen: React.FC<CreatePostScreenProps> = (props) => {
message: '帖子已提交,内容审核中,稍后展示',
duration: 2600,
});
navigation.goBack();
navigation.reset({
index: 0,
routes: [{ name: 'Main' }],
});
}
}
} catch (error) {