Ver Fonte

Bugfix lower case for comparison

Carsten Porth há 6 anos atrás
pai
commit
95edc15cd6
1 ficheiros alterados com 3 adições e 2 exclusões
  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],