Hide call buttons when on call
This commit is contained in:
parent
a7854c6083
commit
decc93532b
18 changed files with 622 additions and 366 deletions
|
@ -1,9 +1,6 @@
|
|||
/* global
|
||||
_,
|
||||
Backbone,
|
||||
i18n,
|
||||
MessageController,
|
||||
moment,
|
||||
Whisper
|
||||
*/
|
||||
|
||||
|
@ -98,59 +95,4 @@
|
|||
},
|
||||
update: debouncedCheckExpiringMessages,
|
||||
};
|
||||
|
||||
const TimerOption = Backbone.Model.extend({
|
||||
getName() {
|
||||
return (
|
||||
i18n(['timerOption', this.get('time'), this.get('unit')].join('_')) ||
|
||||
moment.duration(this.get('time'), this.get('unit')).humanize()
|
||||
);
|
||||
},
|
||||
getAbbreviated() {
|
||||
return i18n(
|
||||
['timerOption', this.get('time'), this.get('unit'), 'abbreviated'].join(
|
||||
'_'
|
||||
)
|
||||
);
|
||||
},
|
||||
});
|
||||
Whisper.ExpirationTimerOptions = new (Backbone.Collection.extend({
|
||||
model: TimerOption,
|
||||
getName(seconds = 0) {
|
||||
const o = this.findWhere({ seconds });
|
||||
if (o) {
|
||||
return o.getName();
|
||||
}
|
||||
return [seconds, 'seconds'].join(' ');
|
||||
},
|
||||
getAbbreviated(seconds = 0) {
|
||||
const o = this.findWhere({ seconds });
|
||||
if (o) {
|
||||
return o.getAbbreviated();
|
||||
}
|
||||
return [seconds, 's'].join('');
|
||||
},
|
||||
}))(
|
||||
[
|
||||
[0, 'seconds'],
|
||||
[5, 'seconds'],
|
||||
[10, 'seconds'],
|
||||
[30, 'seconds'],
|
||||
[1, 'minute'],
|
||||
[5, 'minutes'],
|
||||
[30, 'minutes'],
|
||||
[1, 'hour'],
|
||||
[6, 'hours'],
|
||||
[12, 'hours'],
|
||||
[1, 'day'],
|
||||
[1, 'week'],
|
||||
].map(o => {
|
||||
const duration = moment.duration(o[0], o[1]); // 5, 'seconds'
|
||||
return {
|
||||
time: o[0],
|
||||
unit: o[1],
|
||||
seconds: duration.asSeconds(),
|
||||
};
|
||||
})
|
||||
);
|
||||
})();
|
||||
|
|
|
@ -33,9 +33,6 @@ const {
|
|||
ContactDetail,
|
||||
} = require('../../ts/components/conversation/ContactDetail');
|
||||
const { ContactListItem } = require('../../ts/components/ContactListItem');
|
||||
const {
|
||||
ConversationHeader,
|
||||
} = require('../../ts/components/conversation/ConversationHeader');
|
||||
const { Emojify } = require('../../ts/components/conversation/Emojify');
|
||||
const { ErrorModal } = require('../../ts/components/ErrorModal');
|
||||
const { Lightbox } = require('../../ts/components/Lightbox');
|
||||
|
@ -63,6 +60,9 @@ const { createTimeline } = require('../../ts/state/roots/createTimeline');
|
|||
const {
|
||||
createCompositionArea,
|
||||
} = require('../../ts/state/roots/createCompositionArea');
|
||||
const {
|
||||
createConversationHeader,
|
||||
} = require('../../ts/state/roots/createConversationHeader');
|
||||
const { createCallManager } = require('../../ts/state/roots/createCallManager');
|
||||
const { createLeftPane } = require('../../ts/state/roots/createLeftPane');
|
||||
const {
|
||||
|
@ -295,7 +295,6 @@ exports.setup = (options = {}) => {
|
|||
ConfirmationModal,
|
||||
ContactDetail,
|
||||
ContactListItem,
|
||||
ConversationHeader,
|
||||
Emojify,
|
||||
ErrorModal,
|
||||
getCallingNotificationText,
|
||||
|
@ -315,6 +314,7 @@ exports.setup = (options = {}) => {
|
|||
const Roots = {
|
||||
createCallManager,
|
||||
createCompositionArea,
|
||||
createConversationHeader,
|
||||
createLeftPane,
|
||||
createSafetyNumberViewer,
|
||||
createShortcutGuideModal,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue