🐛 Bug fixes

This commit is contained in:
LittleSheep 2024-08-04 21:12:35 +08:00
parent d8e79fb4f9
commit 4f6c5aa053
6 changed files with 40 additions and 25 deletions

View File

@ -138,8 +138,9 @@ class AttachmentUploaderController extends GetxController {
queueOfUpload[idx].isCompleted = true;
}
queueOfUpload.value =
queueOfUpload.where((x) => x.error == null).toList(growable: true);
queueOfUpload.value = queueOfUpload
.where((x) => x.error == null && x.isCompleted)
.toList(growable: true);
_stopProgressSyncTimer();
_syncProgress();

View File

@ -89,6 +89,8 @@ class AttachmentProvider extends GetConnect {
final AuthProvider auth = Get.find();
if (auth.isAuthorized.isFalse) throw Exception('unauthorized');
await auth.ensureCredentials();
final filePayload =
dio.MultipartFile.fromBytes(data, filename: basename(path));
final fileAlt = basename(path).contains('.')

View File

@ -59,7 +59,8 @@ class _PostDetailScreenState extends State<PostDetailScreen> {
SliverToBoxAdapter(
child: PostItem(
item: item!,
isClickable: true,
isClickable: false,
isOverrideEmbedClickable: true,
isFullDate: true,
isFullContent: true,
isShowReply: false,

View File

@ -597,30 +597,39 @@ class _AttachmentEditorPopupState extends State<AttachmentEditorPopup> {
mainAxisSize: MainAxisSize.min,
children: [
Expanded(
child: Text(
'attachmentAdd'.tr,
style: Theme.of(context).textTheme.headlineSmall,
maxLines: 2,
overflow: TextOverflow.fade,
child: Row(
children: [
Expanded(
child: Text(
'attachmentAdd'.tr,
style:
Theme.of(context).textTheme.headlineSmall,
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
const SizedBox(width: 10),
Obx(() {
if (_uploadController.isUploading.value) {
return SizedBox(
width: 18,
height: 18,
child: CircularProgressIndicator(
strokeWidth: 2.5,
value: _uploadController
.progressOfUpload.value,
),
);
}
return const SizedBox();
}),
],
),
),
const SizedBox(width: 10),
Obx(() {
if (_uploadController.isUploading.value) {
return SizedBox(
width: 18,
height: 18,
child: CircularProgressIndicator(
strokeWidth: 2.5,
value: _uploadController.progressOfUpload.value,
),
);
}
return const SizedBox();
}),
],
),
),
const SizedBox(width: 20),
Text('attachmentAutoUpload'.tr),
const SizedBox(width: 8),
Switch(

View File

@ -23,6 +23,7 @@ class PostItem extends StatefulWidget {
final bool isReactable;
final bool isShowReply;
final bool isShowEmbed;
final bool isOverrideEmbedClickable;
final bool isFullDate;
final bool isFullContent;
final bool isContentSelectable;
@ -37,6 +38,7 @@ class PostItem extends StatefulWidget {
this.isReactable = true,
this.isShowReply = true,
this.isShowEmbed = true,
this.isOverrideEmbedClickable = false,
this.isFullDate = false,
this.isFullContent = false,
this.isContentSelectable = false,
@ -176,7 +178,7 @@ class _PostItemState extends State<PostItem> {
Widget _buildReply(BuildContext context) {
return OpenContainer(
tappable: widget.isClickable,
tappable: widget.isClickable || widget.isOverrideEmbedClickable,
closedBuilder: (_, openContainer) => Column(
children: [
Row(
@ -223,7 +225,7 @@ class _PostItemState extends State<PostItem> {
Widget _buildRepost(BuildContext context) {
return OpenContainer(
tappable: widget.isClickable,
tappable: widget.isClickable || widget.isOverrideEmbedClickable,
closedBuilder: (_, openContainer) => Column(
children: [
Row(

View File

@ -2,7 +2,7 @@ name: solian
description: "The Solar Network App"
publish_to: "none"
version: 1.2.1+5
version: 1.2.1+6
environment:
sdk: ">=3.3.4 <4.0.0"