Compare commits

...

3 Commits

Author SHA1 Message Date
baed28bef7 🐛 Fix some errors 2025-09-06 23:00:51 +08:00
7a6eecf628 🐛 Fix post shuffle 2025-09-06 23:00:26 +08:00
6a63bc235b 🐛 Fix iOS NSE 2025-09-06 22:52:05 +08:00
5 changed files with 45 additions and 42 deletions

View File

@@ -47,6 +47,7 @@ class NotificationService: UNNotificationServiceExtension {
private func processNotification(request: UNNotificationRequest, content: UNMutableNotificationContent) throws { private func processNotification(request: UNNotificationRequest, content: UNMutableNotificationContent) throws {
switch content.userInfo["type"] as? String { switch content.userInfo["type"] as? String {
case "messages.new": case "messages.new":
content.categoryIdentifier = "REPLYABLE_MESSAGE"
try handleMessagingNotification(request: request, content: content) try handleMessagingNotification(request: request, content: content)
default: default:
try handleDefaultNotification(content: content) try handleDefaultNotification(content: content)
@@ -60,8 +61,6 @@ class NotificationService: UNNotificationServiceExtension {
let pfpIdentifier = meta["pfp"] as? String let pfpIdentifier = meta["pfp"] as? String
content.categoryIdentifier = "REPLYABLE_MESSAGE"
let metaCopy = meta as? [String: Any] ?? [:] let metaCopy = meta as? [String: Any] ?? [:]
let pfpUrl = pfpIdentifier != nil ? getAttachmentUrl(for: pfpIdentifier!) : nil let pfpUrl = pfpIdentifier != nil ? getAttachmentUrl(for: pfpIdentifier!) : nil

View File

@@ -72,7 +72,7 @@ class MarketplaceWebFeedsScreen extends HookConsumerWidget {
searchController.clear(); searchController.clear();
} }
return null; return null;
}, [query.value]); }, [query]);
// Clean up timer on dispose // Clean up timer on dispose
useEffect(() { useEffect(() {

View File

@@ -77,7 +77,7 @@ class MarketplaceStickersScreen extends HookConsumerWidget {
searchController.clear(); searchController.clear();
} }
return null; return null;
}, [query.value]); }, [query]);
// Clean up timer on dispose // Clean up timer on dispose
useEffect(() { useEffect(() {

View File

@@ -48,7 +48,7 @@ class PostFeaturedList extends HookConsumerWidget {
'PostFeaturedList: isCollapsed changed to ${isCollapsed.value}', 'PostFeaturedList: isCollapsed changed to ${isCollapsed.value}',
); );
return null; return null;
}, [isCollapsed.value]); }, [isCollapsed]);
useEffect(() { useEffect(() {
if (featuredPostsAsync.hasValue && featuredPostsAsync.value!.isNotEmpty) { if (featuredPostsAsync.hasValue && featuredPostsAsync.value!.isNotEmpty) {
@@ -93,7 +93,7 @@ class PostFeaturedList extends HookConsumerWidget {
); );
} }
return null; return null;
}, [featuredPostsAsync.value]); }, [featuredPostsAsync]);
return ClipRRect( return ClipRRect(
borderRadius: const BorderRadius.all(Radius.circular(8)), borderRadius: const BorderRadius.all(Radius.circular(8)),

View File

@@ -36,9 +36,11 @@ class PostShuffleScreen extends HookConsumerWidget {
bottom: bottom:
kBottomControlHeight + MediaQuery.of(context).padding.bottom, kBottomControlHeight + MediaQuery.of(context).padding.bottom,
), ),
child: child: Builder(
(postListState.value?.items.length ?? 0) > 0 key: ValueKey(postListState.value?.items.length ?? 0),
? CardSwiper( builder: (context) {
if ((postListState.value?.items.length ?? 0) > 0) {
return CardSwiper(
controller: cardSwiperController, controller: cardSwiperController,
cardsCount: postListState.value!.items.length, cardsCount: postListState.value!.items.length,
isLoop: false, isLoop: false,
@@ -67,15 +69,17 @@ class PostShuffleScreen extends HookConsumerWidget {
), ),
); );
}, },
onEnd: () { onEnd: () async {
if (postListState.value?.hasMore ?? true) { if (postListState.value?.hasMore ?? true) {
postListNotifier.fetch( postListNotifier.forceRefresh();
cursor: postListState.value?.nextCursor,
);
} }
}, },
) );
: Center(child: CircularProgressIndicator()), } else {
return Center(child: CircularProgressIndicator());
}
},
),
), ),
Positioned( Positioned(
left: 0, left: 0,