Skip to content

Commit

Permalink
feat(notification): Fix parsing broad cast message in recent 7 days
Browse files Browse the repository at this point in the history
  • Loading branch information
realth000 committed Aug 21, 2024
1 parent b73cb23 commit 3fdc60e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- 认证:修复登录页面刷新验证码时布局抖动的问题。
- 统计:修复积分统计中的积分值。
- 分区:修复开启帖子筛选条件时,显示没有置顶帖的问题。
- 消息:修复解析7天内的公共消息时失败的问题。

### Changed

Expand Down
10 changes: 6 additions & 4 deletions lib/features/notification/models/message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,12 @@ final class BroadcastMessage with BroadcastMessageMappable {
}
final message = infoNode.querySelector('span')?.innerText.trim();
final messageTime = infoNode
.querySelector('span.xg1')
?.innerText
.trim()
.parseToDateTimeUtc8();
.querySelector('span.xg1')
?.innerText
.trim()
.parseToDateTimeUtc8() ??
// Less than 7 days
infoNode.querySelector('span.xg1 > span')?.title?.parseToDateTimeUtc8();
final redirectUrl = infoNode
.querySelector('a')
?.attributes['href']
Expand Down

0 comments on commit 3fdc60e

Please sign in to comment.