Jelajahi Sumber

Bugfix lower case for comparison

Carsten Porth 6 tahun lalu
induk
melakukan
95edc15cd6
1 mengubah file dengan 3 tambahan dan 2 penghapusan
  1. 3 2
      app/src/components/tweet-body/tweet-body.ts

+ 3 - 2
app/src/components/tweet-body/tweet-body.ts

@@ -131,7 +131,8 @@ export class TweetBodyComponent {
     const res = [];
     mentions.forEach(element => {
       const apiEntity = this.entities.user_mentions.filter(
-        el => el.screen_name === element["screenName"]
+        el =>
+          el.screen_name.toLowerCase() === element["screenName"].toLowerCase()
       )[0];
       res.push({
         start: element.indices[0],
@@ -148,7 +149,7 @@ export class TweetBodyComponent {
     const res = [];
     urls.forEach(element => {
       const apiEntity = this.entities.urls.filter(
-        el => el.url === element["url"]
+        el => el.url.toLowerCase() === element["url"].toLowerCase()
       )[0];
       res.push({
         start: element.indices[0],