feat(Notification): implement notification preferences management and enhance notification handling
- Introduced a new service for managing notification preferences, including push notifications, sound, and vibration settings. - Updated the notification handling logic to respect user preferences, ensuring notifications are displayed according to user settings. - Refactored the App and various screens to integrate the new notification preferences, improving user experience and consistency. - Enhanced the HomeScreen and NotificationSettingsScreen to load and update notification settings seamlessly. - Implemented a mechanism to hide the bottom tab bar based on scroll events, improving navigation usability.
This commit is contained in:
@@ -25,6 +25,10 @@ export class PostMapper {
|
||||
isTop: response.is_pinned || false,
|
||||
status: (response.status || 'published') as 'published' | 'draft' | 'deleted',
|
||||
channelId: response.channel_id,
|
||||
channel:
|
||||
response.channel && response.channel.id
|
||||
? { id: String(response.channel.id), name: String(response.channel.name || '') }
|
||||
: undefined,
|
||||
tags: [],
|
||||
createdAt: new Date(response.created_at || Date.now()),
|
||||
// 空字符串/缺省时用 created_at,避免误用 Date.now() 导致全部显示「刚修改」
|
||||
|
||||
@@ -86,6 +86,8 @@ export interface PostModel {
|
||||
isTop: boolean;
|
||||
status: 'published' | 'draft' | 'deleted';
|
||||
channelId?: string;
|
||||
/** 频道展示用(与 PostDTO.channel 一致) */
|
||||
channel?: { id: string; name: string } | null;
|
||||
tags?: string[];
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
|
||||
@@ -42,6 +42,7 @@ interface PostApiResponse {
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
content_edited_at?: string;
|
||||
channel?: { id: string; name: string } | null;
|
||||
author?: {
|
||||
id: number;
|
||||
username: string;
|
||||
@@ -125,6 +126,7 @@ export class PostRepository implements IPostRepository {
|
||||
isPinned: model.isTop,
|
||||
status: model.status,
|
||||
channelId: model.channelId,
|
||||
channel: model.channel,
|
||||
tags: model.tags || [],
|
||||
createdAt: model.createdAt.toISOString(),
|
||||
updatedAt: model.updatedAt.toISOString(),
|
||||
|
||||
Reference in New Issue
Block a user