瀏覽代碼

Bugfix lower case for comparison

Carsten Porth 6 年之前
父節點
當前提交
95edc15cd6
共有 1 個文件被更改,包括 3 次插入2 次删除
  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],