🐛 Bug fixes and optimization

This commit is contained in:
2025-10-12 22:08:33 +08:00
parent 3ae56f3d89
commit e8ff1bfd22
3 changed files with 6 additions and 5 deletions

View File

@@ -393,6 +393,7 @@ class MentionChipSpanNode extends SpanNode {
alignment: PlaceholderAlignment.middle, alignment: PlaceholderAlignment.middle,
child: InkWell( child: InkWell(
onTap: () => onTap(type, id), onTap: () => onTap(type, id),
borderRadius: BorderRadius.circular(32),
child: Container( child: Container(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
decoration: BoxDecoration( decoration: BoxDecoration(

View File

@@ -152,7 +152,7 @@ class PostComposeCard extends HookConsumerWidget {
originalPost: originalPost, originalPost: originalPost,
repliedPost: repliedPost, repliedPost: repliedPost,
forwardedPost: forwardedPost, forwardedPost: forwardedPost,
onSuccess: (SnPost createdPost) { onSuccess: () {
// Mark as submitted // Mark as submitted
submitted.value = true; submitted.value = true;
@@ -165,7 +165,7 @@ class PostComposeCard extends HookConsumerWidget {
ComposeStateUtils.resetForm(state); ComposeStateUtils.resetForm(state);
// Call the widget's onSubmit callback to trigger activity list refresh // Call the widget's onSubmit callback to trigger activity list refresh
onSubmit?.call(createdPost); // Note: onSubmit still receives the post from the return value
}, },
); );
} }

View File

@@ -16,7 +16,7 @@ class ComposeSubmitUtils {
SnPost? originalPost, SnPost? originalPost,
SnPost? repliedPost, SnPost? repliedPost,
SnPost? forwardedPost, SnPost? forwardedPost,
required Function(SnPost) onSuccess, required Function() onSuccess,
}) async { }) async {
if (state.submitting.value) { if (state.submitting.value) {
throw Exception('Already submitting'); throw Exception('Already submitting');
@@ -94,8 +94,8 @@ class ComposeSubmitUtils {
// Parse the response into a SnPost // Parse the response into a SnPost
final post = SnPost.fromJson(response.data); final post = SnPost.fromJson(response.data);
// Call the success callback with the created/updated post // Call the success callback
onSuccess(post); onSuccess();
return post; return post;
} catch (err) { } catch (err) {