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

Commit

Permalink
Refactor IpcAction
Browse files Browse the repository at this point in the history
  • Loading branch information
k0kubun committed Mar 19, 2016
1 parent 0b530fe commit 79c2385
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import IpcAction from './utils/ipc-action';
import GlobalKeyBind from './utils/global-key-bind';

let store = createStore(rootReducer);
new IpcAction(document).subscribe(store);
new IpcAction.subscribe(store);
new GlobalKeyBind.subscribe(store);

if (process.env.NODE_ENV !== 'production') {
Expand Down
6 changes: 3 additions & 3 deletions src/utils/ipc-action.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import RichState from './rich-state';
import TwitterClient from './twitter-client';

export default class IpcAction {
constructor(document) {
this.document = document;
static subscribe(store) {
new IpcAction().subscribe(store);
}

subscribe(store) {
Expand All @@ -18,7 +18,7 @@ export default class IpcAction {
store.dispatch(Actions.tweets.setInReplyTo(tweet));

// FIXME: Use better way to focus
this.document.getElementById('tweet_editor').focus();
document.getElementById('tweet_editor').focus();
});

ipcRenderer.on('invoke-retweet', (event) => {
Expand Down

0 comments on commit 79c2385

Please sign in to comment.