коммит произвёл
George Goldberg
родитель
ff741740ee
Коммит
54c699b7ca
@@ -44,7 +44,7 @@ export default class Textbox extends React.Component {
|
|||||||
|
|
||||||
this.focus = this.focus.bind(this);
|
this.focus = this.focus.bind(this);
|
||||||
this.recalculateSize = this.recalculateSize.bind(this);
|
this.recalculateSize = this.recalculateSize.bind(this);
|
||||||
this.onRecievedError = this.onRecievedError.bind(this);
|
this.onReceivedError = this.onReceivedError.bind(this);
|
||||||
this.handleKeyPress = this.handleKeyPress.bind(this);
|
this.handleKeyPress = this.handleKeyPress.bind(this);
|
||||||
this.handleKeyDown = this.handleKeyDown.bind(this);
|
this.handleKeyDown = this.handleKeyDown.bind(this);
|
||||||
this.handleBlur = this.handleBlur.bind(this);
|
this.handleBlur = this.handleBlur.bind(this);
|
||||||
@@ -67,7 +67,7 @@ export default class Textbox extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
ErrorStore.addChangeListener(this.onRecievedError);
|
ErrorStore.addChangeListener(this.onReceivedError);
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillMount() {
|
componentWillMount() {
|
||||||
@@ -75,10 +75,10 @@ export default class Textbox extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
ErrorStore.removeChangeListener(this.onRecievedError);
|
ErrorStore.removeChangeListener(this.onReceivedError);
|
||||||
}
|
}
|
||||||
|
|
||||||
onRecievedError() {
|
onReceivedError() {
|
||||||
const errorCount = ErrorStore.getConnectionErrorCount();
|
const errorCount = ErrorStore.getConnectionErrorCount();
|
||||||
|
|
||||||
if (errorCount > 1) {
|
if (errorCount > 1) {
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ class NotificationStoreClass extends EventEmitter {
|
|||||||
this.inFocus = focus;
|
this.inFocus = focus;
|
||||||
}
|
}
|
||||||
|
|
||||||
handleRecievedPost(post, msgProps) {
|
handleReceivedPost(post, msgProps) {
|
||||||
// Send desktop notification
|
// Send desktop notification
|
||||||
if ((UserStore.getCurrentId() !== post.user_id || post.props.from_webhook === 'true')) {
|
if ((UserStore.getCurrentId() !== post.user_id || post.props.from_webhook === 'true')) {
|
||||||
if (PostUtils.isSystemMessage(post)) {
|
if (PostUtils.isSystemMessage(post)) {
|
||||||
@@ -129,7 +129,7 @@ NotificationStore.dispatchToken = AppDispatcher.register((payload) => {
|
|||||||
|
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case ActionTypes.RECEIVED_POST:
|
case ActionTypes.RECEIVED_POST:
|
||||||
NotificationStore.handleRecievedPost(action.post, action.websocketMessageProps);
|
NotificationStore.handleReceivedPost(action.post, action.websocketMessageProps);
|
||||||
NotificationStore.emitChange();
|
NotificationStore.emitChange();
|
||||||
break;
|
break;
|
||||||
case ActionTypes.BROWSER_CHANGE_FOCUS:
|
case ActionTypes.BROWSER_CHANGE_FOCUS:
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user