Skip to content

Commit f9d2116

Browse files
authored
fix(ui): link text was passed to the onLinkTap callback instead of link href (#2437)
1 parent 8b8e29d commit f9d2116

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

CONTRIBUTING.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,10 @@ PR titles should follow the format below:
160160
4. *types* other than `fix:` and `feat:` are allowed, for example **[@commitlint/config-conventional](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional)** (based on the **[the Angular convention](https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#-commit-message-guidelines)**) recommends `build:``chore:``ci:``docs:``style:``refactor:``perf:``test:`, and others.
161161
5. *footers* other than `BREAKING CHANGE: <description>` may be provided and follow a convention similar to **[git trailer format](https://git-scm.com/docs/git-interpret-trailers)**.
162162

163+
### CHANGELOG.md Updates 📝
164+
165+
After making changes, please ensure you update the `CHANGELOG.md` file located in the root of each package you modified.
166+
163167
### Testing
164168

165169
At Stream, we value testing. Every PR should include passing tests for existing and new features. To run our test suite locally, you can use the following *Melos* command:
@@ -169,12 +173,6 @@ At Stream, we value testing. Every PR should include passing tests for existing
169173
> melos run test:flutter
170174
```
171175

172-
### Our Process
173-
174-
By default, our development branch is `develop`. Contributors should create new PRs based on `develop` when working on new features.
175-
176-
Develop is merged into master after the team performs various automated and QA tests on the branch. Master can be considered our stable branch, it represents the latest published release on pub.dev.
177-
178176
---
179177

180178
# Versioning Policy

packages/stream_chat_flutter/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## Upcoming
2+
3+
🐞 Fixed
4+
5+
- Fixed mistakenly passing the hyperlink text to the `onLinkTap` callback instead of the actual `href`.
6+
17
## 9.19.0
28

39
✅ Added

packages/stream_chat_flutter/lib/src/message_widget/message_text.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,23 +47,23 @@ class StreamMessageText extends StatelessWidget {
4747
messageTheme: messageTheme,
4848
selectable: isDesktopDeviceOrWeb,
4949
onTapLink: (
50-
String link,
50+
String text,
5151
String? href,
5252
String title,
5353
) {
54-
if (link.startsWith('@')) {
54+
if (text.startsWith('@')) {
5555
final mentionedUser = message.mentionedUsers.firstWhereOrNull(
56-
(u) => '@${u.name}' == link,
56+
(u) => '@${u.name}' == text,
5757
);
5858

5959
if (mentionedUser == null) return;
6060

6161
onMentionTap?.call(mentionedUser);
62-
} else {
62+
} else if (href != null) {
6363
if (onLinkTap != null) {
64-
onLinkTap!(link);
64+
onLinkTap!(href);
6565
} else {
66-
launchURL(context, link);
66+
launchURL(context, href);
6767
}
6868
}
6969
},

0 commit comments

Comments
 (0)