Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.

Commit

Permalink
v0.1.6 英語のときに自身の名前を取得できるようにした
Browse files Browse the repository at this point in the history
  • Loading branch information
mohno007 committed Jan 9, 2019
1 parent 97812b3 commit 0b3c195
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "typetalk-emoreact",
"version": "0.1.5",
"version": "0.1.6",
"description": "",
"scripts": {
"build": "rollup --config",
Expand Down
6 changes: 5 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,12 @@ const mountEmoreact = messages => {
const typetalk = new Typetalk();
const actions_ = typetalkSideEffect(typetalk)(actions);

// TODO ここの取得もいい感じにしたい
let myNameOpt = document.querySelector('.profile-content__name');
myNameOpt = myNameOpt && myNameOpt.textContent.match(/(.*) さん/);
myNameOpt =
myNameOpt &&
(myNameOpt.textContent.match(/(.*) さん/) ||
myNameOpt.textContent.match(/Hi, (.*)/));
myNameOpt = myNameOpt && myNameOpt[1];

if (!myNameOpt) return;
Expand Down

0 comments on commit 0b3c195

Please sign in to comment.