Compare commits
	
		
			2 Commits
		
	
	
		
			f00135c4bf
			...
			e2dc520012
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| e2dc520012 | |||
| cff9c15e31 | 
| @@ -144,6 +144,7 @@ | ||||
|     "other": "{} attachments" | ||||
|   }, | ||||
|   "edited": "Edited", | ||||
|   "editedAt": "Edited at {}", | ||||
|   "addVideo": "Add video", | ||||
|   "addPhoto": "Add photo", | ||||
|   "addAudio": "Add audio", | ||||
|   | ||||
| @@ -279,18 +279,14 @@ class _DraftItem extends StatelessWidget { | ||||
|  | ||||
|   String _parseVisibility(int visibility) { | ||||
|     switch (visibility) { | ||||
|       case 0: | ||||
|         return 'public'.tr(); | ||||
|       case 1: | ||||
|         return 'unlisted'.tr(); | ||||
|         return 'postVisibilityFriends'; | ||||
|       case 2: | ||||
|         return 'friends'.tr(); | ||||
|         return 'postVisibilityUnlisted'; | ||||
|       case 3: | ||||
|         return 'selected'.tr(); | ||||
|       case 4: | ||||
|         return 'private'.tr(); | ||||
|         return 'postVisibilityPrivate'; | ||||
|       default: | ||||
|         return 'unknown'.tr(); | ||||
|         return 'postVisibilityPublic'; | ||||
|     } | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -314,6 +314,19 @@ class PostItem extends HookConsumerWidget { | ||||
|       } | ||||
|     } | ||||
|  | ||||
|     String _parseVisibility(int visibility) { | ||||
|       switch (visibility) { | ||||
|         case 1: | ||||
|           return 'postVisibilityFriends'; | ||||
|         case 2: | ||||
|           return 'postVisibilityUnlisted'; | ||||
|         case 3: | ||||
|           return 'postVisibilityPrivate'; | ||||
|         default: | ||||
|           return 'postVisibilityPublic'; | ||||
|       } | ||||
|     } | ||||
|  | ||||
|     return Column( | ||||
|       mainAxisSize: MainAxisSize.min, | ||||
|       crossAxisAlignment: CrossAxisAlignment.start, | ||||
| @@ -349,13 +362,29 @@ class PostItem extends HookConsumerWidget { | ||||
|                       Text('@${item.publisher.name}').fontSize(11), | ||||
|                     ], | ||||
|                   ), | ||||
|                   Text( | ||||
|                     isFullPost | ||||
|                         ? (item.publishedAt ?? item.createdAt)!.formatSystem() | ||||
|                         : (item.publishedAt ?? item.createdAt)!.formatRelative( | ||||
|                           context, | ||||
|                         ), | ||||
|                   ).fontSize(10), | ||||
|                   Row( | ||||
|                     spacing: 6, | ||||
|                     crossAxisAlignment: CrossAxisAlignment.end, | ||||
|                     children: [ | ||||
|                       Text( | ||||
|                         isFullPost | ||||
|                             ? (item.publishedAt ?? item.createdAt)! | ||||
|                                 .formatSystem() | ||||
|                             : (item.publishedAt ?? item.createdAt)! | ||||
|                                 .formatRelative(context), | ||||
|                       ).fontSize(10), | ||||
|                       if (item.editedAt != null) | ||||
|                         Text( | ||||
|                           'editedAt'.tr(args: [item.editedAt!.formatSystem()]), | ||||
|                           style: TextStyle(height: 1.2), | ||||
|                         ).fontSize(10), | ||||
|                       if (item.visibility != 0) | ||||
|                         Text( | ||||
|                           _parseVisibility(item.visibility).tr(), | ||||
|                           style: TextStyle(height: 1.45), | ||||
|                         ).fontSize(10), | ||||
|                     ], | ||||
|                   ), | ||||
|                 ], | ||||
|               ), | ||||
|             ), | ||||
| @@ -781,10 +810,14 @@ class PostReplyPreview extends HookConsumerWidget { | ||||
|           '/sphere/posts/${parent.id}/replies', | ||||
|           queryParameters: {'offset': posts.value.length, 'take': pageSize}, | ||||
|         ); | ||||
|         posts.value = [ | ||||
|           ...posts.value, | ||||
|           ...response.data.map((e) => SnPost.fromJson(e)), | ||||
|         ]; | ||||
|         try { | ||||
|           posts.value = [ | ||||
|             ...posts.value, | ||||
|             ...response.data.map((e) => SnPost.fromJson(e)), | ||||
|           ]; | ||||
|         } catch (_) { | ||||
|           // ignore disposed | ||||
|         } | ||||
|       } catch (err) { | ||||
|         showErrorAlert(err); | ||||
|       } finally { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user