Skip to content

Commit

Permalink
Disable more chat inputs when offline.
Browse files Browse the repository at this point in the history
  • Loading branch information
nadimkobeissi committed Aug 22, 2016
1 parent 85138a5 commit 9eb5549
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions src/js/win/chat.js
Expand Up @@ -655,6 +655,12 @@ window.addEventListener('load', function(e) {
},
record: function(e) {
var _t = this;
if (
!_t.state.status ||
!_t.state.connected
) {
return false;
}
if (!this.state.recordVisible) {
Cryptocat.Recording.createStream(function(stream) {
thisChat.window.setState({
Expand Down Expand Up @@ -729,6 +735,13 @@ window.addEventListener('load', function(e) {
});
},
sendFileDialog: function(e) {
var _t = this;
if (
!_t.state.status ||
!_t.state.connected
) {
return false;
}
document.getElementById('chatInputText').focus();
IPCRenderer.send(
'chat.openDialog',
Expand Down Expand Up @@ -867,55 +880,87 @@ window.addEventListener('load', function(e) {
'data-sticker': 'smiling',
title: 'Smiling',
onClick: this.sendSticker,
disabled: (
!this.state.status ||
!this.state.connected
),
key: 7
}), React.createElement('input', {
type: 'button',
className: 'chatToolbarButton',
'data-sticker': 'grinning',
onClick: this.sendSticker,
title: 'Grinning',
disabled: (
!this.state.status ||
!this.state.connected
),
key: 8
}), React.createElement('input', {
type: 'button',
className: 'chatToolbarButton',
'data-sticker': 'content',
onClick: this.sendSticker,
title: 'Content',
disabled: (
!this.state.status ||
!this.state.connected
),
key: 9
}), React.createElement('input', {
type: 'button',
className: 'chatToolbarButton',
'data-sticker': 'inLove',
onClick: this.sendSticker,
title: 'In Love',
disabled: (
!this.state.status ||
!this.state.connected
),
key: 10
}), React.createElement('input', {
type: 'button',
className: 'chatToolbarButton',
'data-sticker': 'challengeAccepted',
onClick: this.sendSticker,
title: 'Challenge Accepted!',
disabled: (
!this.state.status ||
!this.state.connected
),
key: 11
}), React.createElement('input', {
type: 'button',
className: 'chatToolbarButton',
'data-sticker': 'angry',
onClick: this.sendSticker,
title: 'Angry',
disabled: (
!this.state.status ||
!this.state.connected
),
key: 12
}), React.createElement('input', {
type: 'button',
className: 'chatToolbarButton',
'data-sticker': 'confused',
onClick: this.sendSticker,
title: 'Confused',
disabled: (
!this.state.status ||
!this.state.connected
),
key: 13
}), React.createElement('input', {
type: 'button',
className: 'chatToolbarButton',
'data-sticker': 'crying',
onClick: this.sendSticker,
title: 'Crying',
disabled: (
!this.state.status ||
!this.state.connected
),
key: 14
}), React.createElement('div', {
className: 'recordModal',
Expand Down Expand Up @@ -962,12 +1007,20 @@ window.addEventListener('load', function(e) {
onClick: this.record,
title: 'Record Audio/Video',
'data-active': this.state.recordVisible,
disabled: (
!this.state.status ||
!this.state.connected
),
key: 23
}), React.createElement('input', {
type: 'button',
className: 'sendFileButton',
onClick: this.sendFileDialog,
title: 'Send File',
disabled: (
!this.state.status ||
!this.state.connected
),
key: 24
})), React.createElement('textarea', {
id: 'chatInputText',
Expand Down

0 comments on commit 9eb5549

Please sign in to comment.