edited for code style consistency
This commit is contained in:
@@ -138,10 +138,10 @@ export function imageCrop(mime, objURL, left, top, width, height, scale) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const img = new Image();
|
||||
img.crossOrigin = 'Anonymous';
|
||||
img.onerror = (err) => {
|
||||
img.onerror = _ => {
|
||||
reject(new Error("Image format unrecognized"));
|
||||
};
|
||||
img.onload = () => {
|
||||
img.onload = _ => {
|
||||
// Once the image is loaded, the URL is no longer needed.
|
||||
URL.revokeObjectURL(img.src);
|
||||
|
||||
@@ -175,7 +175,7 @@ export function fileToBase64(file) {
|
||||
reader.onerror = (evt) => {
|
||||
reject(reader.error);
|
||||
};
|
||||
reader.onload = () => {
|
||||
reader.onload = _ => {
|
||||
resolve({mime: file.type, bits: reader.result.split(',')[1], name: file.name});
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
@@ -189,7 +189,7 @@ export function blobToBase64(blob) {
|
||||
reader.onerror = _ => {
|
||||
reject(reader.error);
|
||||
};
|
||||
reader.onload = () => {
|
||||
reader.onload = _ => {
|
||||
resolve({mime: blob.type, bits: reader.result.split(',')[1]});
|
||||
};
|
||||
reader.readAsDataURL(blob);
|
||||
|
||||
@@ -76,7 +76,7 @@ class AccSecurityView extends React.Component {
|
||||
this.props.onShowAlert(
|
||||
formatMessage(messages.delete_account), // title
|
||||
formatMessage(messages.delete_account_warning), // content
|
||||
(() => { this.props.onDeleteAccount(); }), // onConfirm
|
||||
(_ => this.props.onDeleteAccount()), // onConfirm
|
||||
null, // use default text "OK"
|
||||
true, // Show Reject button
|
||||
null // use default text "Cancel"
|
||||
|
||||
@@ -410,11 +410,10 @@ class InfoView extends React.Component {
|
||||
}
|
||||
|
||||
const isMe = this.props.tinode.isMe(params.topicName);
|
||||
const menuItems = [
|
||||
{title: formatMessage(messages.edit_permissions), handler: () => {
|
||||
this.handleLaunchPermissionsEditor(isMe ? 'want' : 'user', params.topicName);
|
||||
}}
|
||||
];
|
||||
const menuItems = [{
|
||||
title: formatMessage(messages.edit_permissions),
|
||||
handler: _ => this.handleLaunchPermissionsEditor(isMe ? 'want' : 'user', params.topicName)
|
||||
}];
|
||||
if (!isMe) {
|
||||
menuItems.push('member_delete');
|
||||
}
|
||||
|
||||
+10
-13
@@ -400,7 +400,7 @@ class MessagesView extends React.Component {
|
||||
|
||||
const setQuery = newTopic ? this.props.newTopicParams : undefined;
|
||||
topic.subscribe(getQuery.build(), setQuery)
|
||||
.then((ctrl) => {
|
||||
.then(ctrl => {
|
||||
if (ctrl.code == 303) {
|
||||
// Redirect to another topic requested.
|
||||
HashNavigation.navigateTo(HashNavigation.setUrlTopic('', ctrl.params.topic));
|
||||
@@ -430,7 +430,7 @@ class MessagesView extends React.Component {
|
||||
topic.delMessagesList(calls, true);
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
.catch(err => {
|
||||
console.error("Failed subscription to", this.state.topic, err);
|
||||
this.props.onError(err.message, 'err');
|
||||
const blankState = MessagesView.getDerivedStateFromProps({}, {});
|
||||
@@ -447,8 +447,8 @@ class MessagesView extends React.Component {
|
||||
const oldTopic = this.props.tinode.getTopic(oldTopicName);
|
||||
if (oldTopic && oldTopic.isSubscribed()) {
|
||||
oldTopic.leave(false)
|
||||
.catch(() => { /* do nothing here */ })
|
||||
.finally(() => {
|
||||
.catch(_ => { /* do nothing here */ })
|
||||
.finally(_ => {
|
||||
// We don't care if the request succeeded or failed.
|
||||
// The topic is dead regardless.
|
||||
this.setState({fetchingMessages: false});
|
||||
@@ -487,10 +487,10 @@ class MessagesView extends React.Component {
|
||||
if (event.target.scrollTop <= 0) {
|
||||
const topic = this.props.tinode.getTopic(this.state.topic);
|
||||
if (topic && topic.isSubscribed() && topic.msgHasMoreMessages()) {
|
||||
this.setState({fetchingMessages: true}, () => {
|
||||
this.setState({fetchingMessages: true}, _ => {
|
||||
topic.getMessagesPage(MESSAGES_PAGE)
|
||||
.catch((err) => this.props.onError(err.message, 'err'))
|
||||
.finally(() => this.setState({fetchingMessages: false}));
|
||||
.catch(err => this.props.onError(err.message, 'err'))
|
||||
.finally(_ => this.setState({fetchingMessages: false}));
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -656,9 +656,7 @@ class MessagesView extends React.Component {
|
||||
switch (info.what) {
|
||||
case 'kp': {
|
||||
clearTimeout(this.keyPressTimer);
|
||||
this.keyPressTimer = setTimeout(() => {
|
||||
this.setState({typingIndicator: false});
|
||||
}, KEYPRESS_DELAY + 1000);
|
||||
this.keyPressTimer = setTimeout(_ => this.setState({typingIndicator: false}), KEYPRESS_DELAY + 1000);
|
||||
if (!this.state.typingIndicator) {
|
||||
this.setState({typingIndicator: true});
|
||||
}
|
||||
@@ -893,9 +891,8 @@ class MessagesView extends React.Component {
|
||||
}
|
||||
// Pass data and the uploader to the TinodeWeb.
|
||||
this.sendMessage(msg, uploadCompletionPromise, uploader);
|
||||
}).catch((err) => {
|
||||
this.props.onError(err, 'err');
|
||||
});
|
||||
})
|
||||
.catch(err => this.props.onError(err, 'err'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -35,9 +35,7 @@ export default class PasswordResetView extends React.PureComponent {
|
||||
} else {
|
||||
const email = this.state.email.trim();
|
||||
this.setState({email: email});
|
||||
this.props.onRequest('email', email).then(() => {
|
||||
this.setState({sent: true});
|
||||
});
|
||||
this.props.onRequest('email', email).then(_ => this.setState({sent: true}));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+74
-105
@@ -303,7 +303,7 @@ class TinodeWeb extends React.Component {
|
||||
if (this.state.desktopAlerts) {
|
||||
this.tinode.setDeviceToken(this.state.firebaseToken);
|
||||
}
|
||||
}).catch(() => {
|
||||
}).catch(_ => {
|
||||
// do nothing: handled earlier.
|
||||
// catch needed to pervent unnecessary logging of error.
|
||||
});
|
||||
@@ -322,7 +322,7 @@ class TinodeWeb extends React.Component {
|
||||
// When reading from storage, date is returned as string.
|
||||
token.expires = new Date(token.expires);
|
||||
this.tinode.setAuthToken(token);
|
||||
this.tinode.connect().catch((err) => {
|
||||
this.tinode.connect().catch(err => {
|
||||
// Socket error
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
@@ -400,7 +400,7 @@ class TinodeWeb extends React.Component {
|
||||
// (a) for channels always,
|
||||
// (b) pushes when the app is in foreground but has no focus.
|
||||
firebaseOnMessage(this.fcm, (payload) => { this.handlePushMessage(payload); });
|
||||
}).catch((err) => {
|
||||
}).catch(err => {
|
||||
// SW registration or FCM has failed :(
|
||||
onError(err);
|
||||
throw err;
|
||||
@@ -454,9 +454,9 @@ class TinodeWeb extends React.Component {
|
||||
|
||||
// Check if a newer version of TinodeWeb app is available at the server.
|
||||
checkForAppUpdate(reg) {
|
||||
reg.onupdatefound = () => {
|
||||
reg.onupdatefound = _ => {
|
||||
const installingWorker = reg.installing;
|
||||
installingWorker.onstatechange = () => {
|
||||
installingWorker.onstatechange = _ => {
|
||||
if (installingWorker.state == 'installed' && navigator.serviceWorker.controller) {
|
||||
const msg = <>
|
||||
<FormattedMessage id="update_available"
|
||||
@@ -570,7 +570,7 @@ class TinodeWeb extends React.Component {
|
||||
if (this.tinode.isConnected()) {
|
||||
this.doLogin(login, password, null, {meth: this.state.credMethod, resp: this.state.credCode});
|
||||
} else {
|
||||
this.tinode.connect().catch((err) => {
|
||||
this.tinode.connect().catch(err => {
|
||||
// Socket error
|
||||
this.setState({loginDisabled: false, autoLogin: false, loadSpinnerVisible: false});
|
||||
this.handleError(err.message, 'err');
|
||||
@@ -581,12 +581,12 @@ class TinodeWeb extends React.Component {
|
||||
// Enable or disable saving the password and IndexedDB.
|
||||
handlePersistenceChange(persist) {
|
||||
if (persist) {
|
||||
this.tinode.initStorage().then(() => {
|
||||
this.tinode.initStorage().then(_ => {
|
||||
LocalStorageUtil.setObject('keep-logged-in', true);
|
||||
this.setState({persist: true});
|
||||
});
|
||||
} else {
|
||||
this.tinode.clearStorage().then(() => {
|
||||
this.tinode.clearStorage().then(_ => {
|
||||
LocalStorageUtil.setObject('keep-logged-in', false);
|
||||
this.setState({persist: false});
|
||||
});
|
||||
@@ -625,7 +625,7 @@ class TinodeWeb extends React.Component {
|
||||
prom.then(_ => {
|
||||
// Reconnected: clear error
|
||||
this.handleError();
|
||||
}).catch((err) => {
|
||||
}).catch(err => {
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
return;
|
||||
@@ -701,7 +701,7 @@ class TinodeWeb extends React.Component {
|
||||
loginPromise = connectionPromise.then(_ => this.tinode.loginToken(token, cred));
|
||||
}
|
||||
|
||||
loginPromise.then((ctrl) => {
|
||||
loginPromise.then(ctrl => {
|
||||
if (ctrl.code >= 300 && ctrl.text === 'validate credentials') {
|
||||
this.setState({loadSpinnerVisible: false});
|
||||
if (cred) {
|
||||
@@ -711,7 +711,7 @@ class TinodeWeb extends React.Component {
|
||||
} else {
|
||||
this.handleLoginSuccessful();
|
||||
}
|
||||
}).catch((err) => {
|
||||
}).catch(err => {
|
||||
// Connection or login failed, report error.
|
||||
this.setState({
|
||||
loginDisabled: false,
|
||||
@@ -768,12 +768,12 @@ class TinodeWeb extends React.Component {
|
||||
withTags().
|
||||
withCred().
|
||||
build()
|
||||
).catch((err) => {
|
||||
).catch(err => {
|
||||
this.tinode.disconnect();
|
||||
localStorage.removeItem('auth-token');
|
||||
this.handleError(err.message, 'err');
|
||||
HashNavigation.navigateTo('');
|
||||
}).finally(() => {
|
||||
}).finally(_ => {
|
||||
this.setState({loadSpinnerVisible: false});
|
||||
});
|
||||
let urlHash = HashNavigation.setUrlSidePanel(window.location.hash, 'contacts');
|
||||
@@ -934,7 +934,7 @@ class TinodeWeb extends React.Component {
|
||||
if (fnd.isSubscribed()) {
|
||||
this.tnFndSubsUpdated();
|
||||
} else {
|
||||
fnd.subscribe(fnd.startMetaQuery().withSub().build()).catch((err) => {
|
||||
fnd.subscribe(fnd.startMetaQuery().withSub().build()).catch(err => {
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
}
|
||||
@@ -957,11 +957,9 @@ class TinodeWeb extends React.Component {
|
||||
*/
|
||||
handleSearchContacts(query) {
|
||||
const fnd = this.tinode.getFndTopic();
|
||||
fnd.setMeta({desc: {public: query}}).then((ctrl) => {
|
||||
return fnd.getMeta(fnd.startMetaQuery().withSub().build());
|
||||
}).catch((err) => {
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
fnd.setMeta({desc: {public: query}})
|
||||
.then(_ => fnd.getMeta(fnd.startMetaQuery().withSub().build()))
|
||||
.catch(err => this.handleError(err.message, 'err'));
|
||||
}
|
||||
|
||||
// User clicked on a topic in the side panel or deleted a topic.
|
||||
@@ -1043,7 +1041,7 @@ class TinodeWeb extends React.Component {
|
||||
// Topic is not subscribed yet. Subscribe.
|
||||
const subscribePromise =
|
||||
topic.subscribe()
|
||||
.then(() => {
|
||||
.then(_ => {
|
||||
// If there are unsent messages (except video call messages),
|
||||
// try sending them now. Unsent video call messages will be dropped.
|
||||
let calls = [];
|
||||
@@ -1069,15 +1067,13 @@ class TinodeWeb extends React.Component {
|
||||
|
||||
// TODO: check if return is required.
|
||||
return topic.publishDraft(msg, Promise.all(completion))
|
||||
.then((ctrl) => {
|
||||
.then(ctrl => {
|
||||
if (topic.isArchived()) {
|
||||
topic.archive(false);
|
||||
}
|
||||
return ctrl;
|
||||
})
|
||||
.catch((err) => {
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
.catch(err => this.handleError(err.message, 'err'));
|
||||
}
|
||||
|
||||
handleNewChatInvitation(topicName, action) {
|
||||
@@ -1091,9 +1087,7 @@ class TinodeWeb extends React.Component {
|
||||
if (topic.isP2PType()) {
|
||||
// For P2P topics change 'given' permission of the peer too.
|
||||
// In p2p topics the other user has the same name as the topic.
|
||||
response = response.then((ctrl) => {
|
||||
topic.setMeta({sub: {user: topicName, mode: mode}});
|
||||
});
|
||||
response = response.then(_ => topic.setMeta({sub: {user: topicName, mode: mode}}));
|
||||
}
|
||||
break;
|
||||
case 'delete':
|
||||
@@ -1104,18 +1098,14 @@ class TinodeWeb extends React.Component {
|
||||
// Ban the topic making futher invites impossible.
|
||||
// Just self-ban.
|
||||
const am = topic.getAccessMode().updateWant('-JP').getWant();
|
||||
response = topic.setMeta({sub: {mode: am}}).then((ctrl) => {
|
||||
return this.handleTopicSelected(null);
|
||||
});
|
||||
response = topic.setMeta({sub: {mode: am}}).then(_ => this.handleTopicSelected(null));
|
||||
break;
|
||||
default:
|
||||
console.warn("Unknown invitation action", '"' + action + '""');
|
||||
}
|
||||
|
||||
if (response != null) {
|
||||
response.catch((err) => {
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
response.catch(err => this.handleError(err.message, 'err'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1156,7 +1146,7 @@ class TinodeWeb extends React.Component {
|
||||
|
||||
const me = this.tinode.getMeTopic();
|
||||
const am = me.getAccessMode().updateWant(on ? '-P' : '+P').getWant();
|
||||
me.setMeta({sub: {mode: am}}).catch((err) => {
|
||||
me.setMeta({sub: {mode: am}}).catch(err => {
|
||||
// Request failed, keep existing state.
|
||||
this.setState({incognitoMode: !on});
|
||||
this.handleError(err.message, 'err');
|
||||
@@ -1165,9 +1155,7 @@ class TinodeWeb extends React.Component {
|
||||
|
||||
handleUpdateAccountTagsRequest(tags) {
|
||||
this.tinode.getMeTopic().setMeta({tags: tags})
|
||||
.catch((err) => {
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
.catch(err => this.handleError(err.message, 'err'));
|
||||
}
|
||||
|
||||
// User chose Settings menu item.
|
||||
@@ -1235,9 +1223,9 @@ class TinodeWeb extends React.Component {
|
||||
}
|
||||
}
|
||||
} else if (this.state.firebaseToken && this.fcm) {
|
||||
firebaseDelToken(this.fcm).catch((err) => {
|
||||
firebaseDelToken(this.fcm).catch(err => {
|
||||
console.error("Unable to delete token.", err);
|
||||
}).finally(() => {
|
||||
}).finally(_ => {
|
||||
LocalStorageUtil.updateObject('settings', {desktopAlerts: false});
|
||||
localStorage.removeItem('firebase-token');
|
||||
this.setState({desktopAlerts: false, firebaseToken: null});
|
||||
@@ -1259,16 +1247,14 @@ class TinodeWeb extends React.Component {
|
||||
|
||||
handleCredAdd(method, value) {
|
||||
const me = this.tinode.getMeTopic();
|
||||
me.setMeta({cred: {meth: method, val: value}}).catch((err) => {
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
me.setMeta({cred: {meth: method, val: value}})
|
||||
.catch(err => this.handleError(err.message, 'err'));
|
||||
}
|
||||
|
||||
handleCredDelete(method, value) {
|
||||
const me = this.tinode.getMeTopic();
|
||||
me.delCredential(method, value).catch((err) => {
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
me.delCredential(method, value)
|
||||
.catch(err => this.handleError(err.message, 'err'));
|
||||
}
|
||||
|
||||
handleCredConfirm(method, response) {
|
||||
@@ -1332,7 +1318,7 @@ class TinodeWeb extends React.Component {
|
||||
}
|
||||
}
|
||||
params._topicName = topicName;
|
||||
this.setState({newTopicParams: params}, () => {this.handleTopicSelected(topicName)});
|
||||
this.setState({newTopicParams: params}, _ => {this.handleTopicSelected(topicName)});
|
||||
}
|
||||
|
||||
// New topic was created, here is the new topic name.
|
||||
@@ -1377,18 +1363,15 @@ class TinodeWeb extends React.Component {
|
||||
if (defacs) {
|
||||
params.defacs = defacs;
|
||||
}
|
||||
topic.setMeta({desc: params, attachments: attachments}).catch((err) => {
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
topic.setMeta({desc: params, attachments: attachments})
|
||||
.catch(err => this.handleError(err.message, 'err'));
|
||||
}
|
||||
}
|
||||
|
||||
handleUnarchive(topicName) {
|
||||
const topic = this.tinode.getTopic(topicName);
|
||||
if (topic) {
|
||||
topic.archive(false).catch((err) => {
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
topic.archive(false).catch(err => this.handleError(err.message, 'err'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1396,9 +1379,8 @@ class TinodeWeb extends React.Component {
|
||||
this.handleError();
|
||||
|
||||
if (password) {
|
||||
this.tinode.updateAccountBasic(null, this.tinode.getCurrentLogin(), password).catch((err) => {
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
this.tinode.updateAccountBasic(null, this.tinode.getCurrentLogin(), password)
|
||||
.catch(err => this.handleError(err.message, 'err'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1413,18 +1395,16 @@ class TinodeWeb extends React.Component {
|
||||
am.updateWant(mode);
|
||||
mode = am.getWant();
|
||||
}
|
||||
topic.setMeta({sub: {user: uid, mode: mode}}).catch((err) => {
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
topic.setMeta({sub: {user: uid, mode: mode}})
|
||||
.catch(err => this.handleError(err.message, 'err'));
|
||||
}
|
||||
}
|
||||
|
||||
handleTagsUpdateRequest(topicName, tags) {
|
||||
const topic = this.tinode.getTopic(topicName);
|
||||
if (topic) {
|
||||
topic.setMeta({tags: tags}).catch((err) => {
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
topic.setMeta({tags: tags})
|
||||
.catch(err => this.handleError(err.message, 'err'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1451,9 +1431,9 @@ class TinodeWeb extends React.Component {
|
||||
}
|
||||
this.setState(this.getBlankState());
|
||||
|
||||
cleared.then(() => {
|
||||
cleared.then(_ => {
|
||||
this.tinode = TinodeWeb.tnSetup(this.state.serverAddress, isSecureConnection(),
|
||||
this.state.transport, this.props.intl.locale, LocalStorageUtil.getObject('keep-logged-in'), () => {
|
||||
this.state.transport, this.props.intl.locale, LocalStorageUtil.getObject('keep-logged-in'), _ => {
|
||||
this.tinode.onConnect = this.handleConnected;
|
||||
this.tinode.onDisconnect = this.handleDisconnect;
|
||||
this.tinode.onAutoreconnectIteration = this.handleAutoreconnectIteration;
|
||||
@@ -1477,10 +1457,10 @@ class TinodeWeb extends React.Component {
|
||||
}
|
||||
|
||||
// Request to hard-delete topic.
|
||||
topic.delTopic(true).then((ctrl) => {
|
||||
topic.delTopic(true).then(_ => {
|
||||
// Hide MessagesView and InfoView panels.
|
||||
HashNavigation.navigateTo(HashNavigation.setUrlTopic(window.location.hash, ''));
|
||||
}).catch((err) => {
|
||||
}).catch(err => {
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
}
|
||||
@@ -1492,9 +1472,8 @@ class TinodeWeb extends React.Component {
|
||||
}
|
||||
|
||||
// Request hard-delete all messages.
|
||||
topic.delMessagesAll(true).catch((err) => {
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
topic.delMessagesAll(true)
|
||||
.catch(err => this.handleError(err.message, 'err'));
|
||||
}
|
||||
|
||||
handleLeaveUnsubRequest(topicName) {
|
||||
@@ -1503,10 +1482,10 @@ class TinodeWeb extends React.Component {
|
||||
return;
|
||||
}
|
||||
|
||||
topic.leave(true).then((ctrl) => {
|
||||
topic.leave(true).then(_ => {
|
||||
// Hide MessagesView and InfoView panels.
|
||||
HashNavigation.navigateTo(HashNavigation.setUrlTopic(window.location.hash, ''));
|
||||
}).catch((err) => {
|
||||
}).catch(err => {
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
}
|
||||
@@ -1517,12 +1496,12 @@ class TinodeWeb extends React.Component {
|
||||
return;
|
||||
}
|
||||
|
||||
topic.updateMode(null, '-JP').then(_ => {
|
||||
// Hide MessagesView and InfoView panels.
|
||||
HashNavigation.navigateTo(HashNavigation.setUrlTopic(window.location.hash, ''));
|
||||
}).catch((err) => {
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
topic.updateMode(null, '-JP')
|
||||
.then(_ => {
|
||||
// Hide MessagesView and InfoView panels.
|
||||
HashNavigation.navigateTo(HashNavigation.setUrlTopic(window.location.hash, ''));
|
||||
})
|
||||
.catch(err => this.handleError(err.message, 'err'));
|
||||
}
|
||||
|
||||
handleReportTopic(topicName) {
|
||||
@@ -1535,12 +1514,12 @@ class TinodeWeb extends React.Component {
|
||||
this.tinode.report('report', topicName);
|
||||
|
||||
// Remove J and P permissions.
|
||||
topic.updateMode(null, '-JP').then((ctrl) => {
|
||||
topic.updateMode(null, '-JP')
|
||||
.then(_ => {
|
||||
// Hide MessagesView and InfoView panels.
|
||||
HashNavigation.navigateTo(HashNavigation.setUrlTopic(window.location.hash, ''));
|
||||
}).catch((err) => {
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
})
|
||||
.catch(err => this.handleError(err.message, 'err'));
|
||||
}
|
||||
|
||||
handleShowContextMenu(params, menuItems) {
|
||||
@@ -1637,7 +1616,7 @@ class TinodeWeb extends React.Component {
|
||||
handleContextMenuAction(action, promise, params) {
|
||||
if (action == 'topic_archive') {
|
||||
if (promise && params.topicName && params.topicName == this.state.topicSelected) {
|
||||
promise.then(() => {
|
||||
promise.then(_ => {
|
||||
this.handleTopicSelected(null);
|
||||
});
|
||||
}
|
||||
@@ -1677,17 +1656,15 @@ class TinodeWeb extends React.Component {
|
||||
|
||||
if (added && added.length > 0) {
|
||||
added.map((uid) => {
|
||||
topic.invite(uid, null).catch((err) => {
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
topic.invite(uid, null)
|
||||
.catch(err => this.handleError(err.message, 'err'));
|
||||
});
|
||||
}
|
||||
|
||||
if (removed && removed.length > 0) {
|
||||
removed.map((uid) => {
|
||||
topic.delSubscription(uid).catch((err) => {
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
topic.delSubscription(uid)
|
||||
.catch(err => this.handleError(err.message, 'err'));
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1696,9 +1673,7 @@ class TinodeWeb extends React.Component {
|
||||
if (this.tinode.isAuthenticated()) {
|
||||
// Adding new email or phone number in account setting.
|
||||
this.tinode.getMeTopic().setMeta({cred: {meth: cred, resp: code}})
|
||||
.catch((err) => {
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
.catch(err => this.handleError(err.message, 'err'));
|
||||
} else {
|
||||
// Credential validation on signup.
|
||||
this.setState({credMethod: cred, credCode: code, credToken: token});
|
||||
@@ -1709,10 +1684,8 @@ class TinodeWeb extends React.Component {
|
||||
handlePasswordResetRequest(method, value) {
|
||||
// If already connected, connnect() will return a resolved promise.
|
||||
return this.tinode.connect()
|
||||
.then(() => {
|
||||
return this.tinode.requestResetAuthSecret('basic', method, value);
|
||||
})
|
||||
.catch((err) => {
|
||||
.then(_ => this.tinode.requestResetAuthSecret('basic', method, value))
|
||||
.catch(err => {
|
||||
// Socket error
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
@@ -1724,13 +1697,9 @@ class TinodeWeb extends React.Component {
|
||||
this.handleError(this.props.intl.formatMessage(messages.invalid_security_token), 'err');
|
||||
} else {
|
||||
this.tinode.connect()
|
||||
.then(() => {
|
||||
return this.tinode.updateAccountBasic(null, null, newPassword, {token: token});
|
||||
})
|
||||
.then(() => {
|
||||
HashNavigation.navigateTo('');
|
||||
})
|
||||
.catch((err) => {
|
||||
.then(_ => this.tinode.updateAccountBasic(null, null, newPassword, {token: token}))
|
||||
.then(_ => HashNavigation.navigateTo(''))
|
||||
.catch(err => {
|
||||
// Socket error
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
@@ -1749,7 +1718,7 @@ class TinodeWeb extends React.Component {
|
||||
case CALL_STATE_OUTGOING_INITATED:
|
||||
let head = { webrtc: CALL_HEAD_STARTED };
|
||||
this.handleSendMessage(Drafty.videoCall(), undefined, undefined, head)
|
||||
.then((ctrl) => {
|
||||
.then(ctrl => {
|
||||
if (ctrl.code < 200 || ctrl.code >= 300 || !ctrl.params || !ctrl.params.seq) {
|
||||
this.handleCallClose();
|
||||
return;
|
||||
@@ -1836,7 +1805,7 @@ class TinodeWeb extends React.Component {
|
||||
// We need to switch and subscribe to callTopic first.
|
||||
this.setState({
|
||||
callShouldStart: true,
|
||||
}, () => this.handleTopicSelected(this.state.callTopic));
|
||||
}, _ => this.handleTopicSelected(this.state.callTopic));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1955,9 +1924,9 @@ class TinodeWeb extends React.Component {
|
||||
visible={this.state.alertVisible}
|
||||
title={this.state.alertParams.title}
|
||||
content={this.state.alertParams.content}
|
||||
onReject={this.state.alertParams.onReject ? (() => { this.setState({alertVisible: false}); }) : null}
|
||||
onReject={this.state.alertParams.onReject ? (_ => this.setState({alertVisible: false})) : null}
|
||||
reject={this.state.alertParams.reject}
|
||||
onConfirm={() => { this.setState({alertVisible: false}); this.state.alertParams.onConfirm(); }}
|
||||
onConfirm={_ => {this.setState({alertVisible: false}); this.state.alertParams.onConfirm();}}
|
||||
confirm={this.state.alertParams.confirm}
|
||||
/>
|
||||
<SidepanelView
|
||||
|
||||
@@ -27,15 +27,11 @@ export default class Attachment extends React.Component {
|
||||
const downloader = this.props.tinode.getLargeFileHelper();
|
||||
this.setState({downloader: downloader});
|
||||
downloader.download(url, filename, mimetype,
|
||||
(loaded) => {
|
||||
this.setState({progress: loaded / this.props.size});
|
||||
},
|
||||
(err) => {
|
||||
this.props.onError(err, 'err');
|
||||
}
|
||||
).then(() => {
|
||||
this.setState({downloader: null, progress: 0});
|
||||
}).catch((err) => {
|
||||
loaded => this.setState({progress: loaded / this.props.size}),
|
||||
err => this.props.onError(err, 'err')
|
||||
)
|
||||
.then(_ => this.setState({downloader: null, progress: 0}))
|
||||
.catch(err => {
|
||||
if (err) {
|
||||
this.props.onError("Error downloading file: " + err.message, 'err');
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ export default class AudioPlayer extends React.PureComponent {
|
||||
|
||||
this.canvasContext.lineWidth = LINE_WIDTH;
|
||||
|
||||
const drawFrame = () => {
|
||||
const drawFrame = _ => {
|
||||
if (!this.canvasRef.current || !this.audioPlayer) {
|
||||
// The component is unmounted.
|
||||
return;
|
||||
|
||||
@@ -105,7 +105,7 @@ export default class AudioRecorder extends React.PureComponent {
|
||||
let prevBarCount = 0;
|
||||
let volume = 0.0;
|
||||
let countPerBar = 0;
|
||||
const drawFrame = () => {
|
||||
const drawFrame = _ => {
|
||||
if (!this.startedOn) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -231,7 +231,7 @@ class CallPanel extends React.PureComponent {
|
||||
const desc = new RTCSessionDescription(info.payload);
|
||||
this.state.pc.setRemoteDescription(desc)
|
||||
.then(_ => {
|
||||
this.setState({ callInitialSetupComplete: true }, () => this.drainRemoteIceCandidatesCache());
|
||||
this.setState({ callInitialSetupComplete: true }, _ => this.drainRemoteIceCandidatesCache());
|
||||
})
|
||||
.catch(this.reportError);
|
||||
}
|
||||
@@ -357,7 +357,7 @@ class CallPanel extends React.PureComponent {
|
||||
})
|
||||
.then(_ => {
|
||||
this.props.onSendAnswer(this.props.topic, this.props.seq, pc.localDescription.toJSON());
|
||||
this.setState({ callInitialSetupComplete: true }, () => this.drainRemoteIceCandidatesCache());
|
||||
this.setState({ callInitialSetupComplete: true }, _ => this.drainRemoteIceCandidatesCache());
|
||||
})
|
||||
.catch(this.handleGetUserMediaError);
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@ class ContextMenu extends React.Component {
|
||||
'menu_item_forward': {
|
||||
id: 'menu_item_forward',
|
||||
title: formatMessage(messages.forward),
|
||||
handler: () => {} /* the action is taken directly in tinode-web */
|
||||
handler: _ => {} /* the action is taken directly in tinode-web */
|
||||
},
|
||||
'menu_item_edit': {
|
||||
id: 'menu_item_edit',
|
||||
@@ -227,12 +227,10 @@ class ContextMenu extends React.Component {
|
||||
return props.onShowAlert(
|
||||
formatMessage(messages.block), // title
|
||||
formatMessage(messages.topic_block_warning), // content
|
||||
(() => {
|
||||
return this.topicPermissionSetter('-JP', params, errorHandler).then((ctrl) => {
|
||||
this.props.onTopicRemoved(params.topicName);
|
||||
return ctrl;
|
||||
});
|
||||
}),
|
||||
(_ => this.topicPermissionSetter('-JP', params, errorHandler).then(ctrl => {
|
||||
this.props.onTopicRemoved(params.topicName);
|
||||
return ctrl;
|
||||
})),
|
||||
null, // "OK"
|
||||
true, // Show Reject button
|
||||
null // "Cancel"
|
||||
@@ -246,13 +244,13 @@ class ContextMenu extends React.Component {
|
||||
return props.onShowAlert(
|
||||
formatMessage(messages.topic_delete), // title
|
||||
formatMessage(messages.topic_delete_warning), // content
|
||||
(() => {
|
||||
(_ => {
|
||||
const topic = this.props.tinode.getTopic(params.topicName);
|
||||
if (!topic) {
|
||||
console.warn("Topic not found: ", params.topicName);
|
||||
return;
|
||||
}
|
||||
return topic.delTopic(true).catch((err) => {
|
||||
return topic.delTopic(true).catch(err => {
|
||||
if (errorHandler) {
|
||||
errorHandler(err.message, 'err');
|
||||
}
|
||||
@@ -273,7 +271,7 @@ class ContextMenu extends React.Component {
|
||||
console.warn("Topic not found: ", params.topicName);
|
||||
return;
|
||||
}
|
||||
return topic.archive(true).catch((err) => {
|
||||
return topic.archive(true).catch(err => {
|
||||
if (errorHandler) {
|
||||
errorHandler(err.message, 'err');
|
||||
}
|
||||
@@ -289,7 +287,7 @@ class ContextMenu extends React.Component {
|
||||
console.warn("Topic not found: ", params.topicName);
|
||||
return;
|
||||
}
|
||||
return topic.archive(false).catch((err) => {
|
||||
return topic.archive(false).catch(err => {
|
||||
if (errorHandler) {
|
||||
errorHandler(err.message, 'err');
|
||||
}
|
||||
@@ -311,7 +309,7 @@ class ContextMenu extends React.Component {
|
||||
console.warn("Topic or user not found: '" + params.topicName + "', '" + params.user + "'");
|
||||
return;
|
||||
}
|
||||
return topic.delSubscription(params.user).catch((err) => {
|
||||
return topic.delSubscription(params.user).catch(err => {
|
||||
if (errorHandler) {
|
||||
errorHandler(err.message, 'err');
|
||||
}
|
||||
@@ -406,7 +404,7 @@ class ContextMenu extends React.Component {
|
||||
topic.delMessagesAll(hard) :
|
||||
topic.delMessagesList([params.seq], hard);
|
||||
|
||||
return promise.catch((err) => {
|
||||
return promise.catch(err => {
|
||||
if (errorHandler) {
|
||||
errorHandler(err.message, 'err');
|
||||
}
|
||||
@@ -421,7 +419,7 @@ class ContextMenu extends React.Component {
|
||||
return;
|
||||
}
|
||||
const msg = topic.createMessage(params.content, false);
|
||||
return topic.publishDraft(msg).catch((err) => {
|
||||
return topic.publishDraft(msg).catch(err => {
|
||||
if (errorHandler) {
|
||||
errorHandler(err.message, 'err');
|
||||
}
|
||||
@@ -438,9 +436,7 @@ class ContextMenu extends React.Component {
|
||||
|
||||
let result = topic.updateMode(params.user, mode);
|
||||
if (errorHandler) {
|
||||
result = result.catch((err) => {
|
||||
errorHandler(err.message, 'err');
|
||||
});
|
||||
result = result.catch(err => errorHandler(err.message, 'err'));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ export default class InPlaceEdit extends React.Component {
|
||||
|
||||
handleStartEditing() {
|
||||
if (!this.props.readOnly) {
|
||||
this.setState({active: true}, () => {
|
||||
this.setState({active: true}, _ => {
|
||||
if (this.selfRef.current) {
|
||||
this.selfRef.current.focus();
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ export default class LazyImage extends React.PureComponent {
|
||||
this.props.whenDone
|
||||
.promise
|
||||
.then(data => this.setState({src: data.src, style: {...this.state.style, padding: 0}}))
|
||||
.catch(() => this.setState({src: 'img/broken_image.png'}));
|
||||
.catch(_ => this.setState({src: 'img/broken_image.png'}));
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
@@ -33,7 +33,7 @@ export default class LazyImage extends React.PureComponent {
|
||||
this.props.whenDone
|
||||
.promise
|
||||
.then(data => this.setState({src: data.src, style: {...this.state.style, padding: 0}}))
|
||||
.catch(() => this.setState({src: 'img/broken_image.png'}));
|
||||
.catch(_ => this.setState({src: 'img/broken_image.png'}));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ class TopicSecurity extends React.PureComponent {
|
||||
this.props.onShowAlert(
|
||||
formatMessage(messages.topic_delete), // title
|
||||
formatMessage(messages.topic_delete_warning), // content
|
||||
(() => { this.props.onDeleteTopic(this.props.topic); }), // onConfirm
|
||||
_ => this.props.onDeleteTopic(this.props.topic), // onConfirm
|
||||
null, // "OK"
|
||||
true, // Show Reject button
|
||||
null // "Cancel"
|
||||
@@ -104,7 +104,7 @@ class TopicSecurity extends React.PureComponent {
|
||||
this.props.onShowAlert(
|
||||
formatMessage(this.props.deleter ? messages.delete_messages : messages.clear_messages), // title
|
||||
formatMessage(this.props.deleter ? messages.delete_messages_warning : messages.clear_messages_warning), // content
|
||||
(() => { this.props.onDeleteMessages(this.props.topic); }), // onConfirm
|
||||
_ => this.props.onDeleteMessages(this.props.topic), // onConfirm
|
||||
null, // "OK"
|
||||
true, // Show Reject button
|
||||
null // "Cancel"
|
||||
@@ -117,7 +117,7 @@ class TopicSecurity extends React.PureComponent {
|
||||
this.props.onShowAlert(
|
||||
formatMessage(messages.leave_chat), // title
|
||||
formatMessage(messages.leave_chat_warning), // content
|
||||
(() => { this.props.onLeaveTopic(this.props.topic); }), // onConfirm
|
||||
_ => this.props.onLeaveTopic(this.props.topic), // onConfirm
|
||||
null, // "OK"
|
||||
true, // Show Reject button
|
||||
null // "Cancel"
|
||||
@@ -130,7 +130,7 @@ class TopicSecurity extends React.PureComponent {
|
||||
this.props.onShowAlert(
|
||||
formatMessage(messages.block_contact), // title
|
||||
formatMessage(messages.block_contact_warning), // content
|
||||
(() => { this.props.onBlockTopic(this.props.topic); }), // onConfirm
|
||||
_ => this.props.onBlockTopic(this.props.topic), // onConfirm
|
||||
null, // "OK"
|
||||
true, // Show Reject button
|
||||
null // "Cancel"
|
||||
|
||||
@@ -52,7 +52,7 @@ export default class VisiblePassword extends React.PureComponent {
|
||||
handleEditingFinished(e) {
|
||||
if (e) {
|
||||
let currentTarget = e.currentTarget;
|
||||
setTimeout(() => {
|
||||
setTimeout(_ => {
|
||||
if (!currentTarget.contains(document.activeElement)) {
|
||||
if (this.props.onFinished) {
|
||||
this.props.onFinished(this.state.value);
|
||||
|
||||
+89
-165
@@ -2434,10 +2434,10 @@ function imageCrop(mime, objURL, left, top, width, height, scale) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const img = new Image();
|
||||
img.crossOrigin = 'Anonymous';
|
||||
img.onerror = err => {
|
||||
img.onerror = _ => {
|
||||
reject(new Error("Image format unrecognized"));
|
||||
};
|
||||
img.onload = () => {
|
||||
img.onload = _ => {
|
||||
URL.revokeObjectURL(img.src);
|
||||
let canvas = document.createElement('canvas');
|
||||
canvas.width = width * scale;
|
||||
@@ -2470,7 +2470,7 @@ function fileToBase64(file) {
|
||||
reader.onerror = evt => {
|
||||
reject(reader.error);
|
||||
};
|
||||
reader.onload = () => {
|
||||
reader.onload = _ => {
|
||||
resolve({
|
||||
mime: file.type,
|
||||
bits: reader.result.split(',')[1],
|
||||
@@ -2487,7 +2487,7 @@ function blobToBase64(blob) {
|
||||
reader.onerror = _ => {
|
||||
reject(reader.error);
|
||||
};
|
||||
reader.onload = () => {
|
||||
reader.onload = _ => {
|
||||
resolve({
|
||||
mime: blob.type,
|
||||
bits: reader.result.split(',')[1]
|
||||
@@ -3706,9 +3706,7 @@ class AccSecurityView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Comp
|
||||
} = this.props.intl;
|
||||
this.props.onShowAlert(formatMessage(messages.delete_account),
|
||||
formatMessage(messages.delete_account_warning),
|
||||
() => {
|
||||
this.props.onDeleteAccount();
|
||||
},
|
||||
_ => this.props.onDeleteAccount(),
|
||||
null,
|
||||
true,
|
||||
null);
|
||||
@@ -4952,9 +4950,7 @@ class InfoView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
||||
const isMe = this.props.tinode.isMe(params.topicName);
|
||||
const menuItems = [{
|
||||
title: formatMessage(messages.edit_permissions),
|
||||
handler: () => {
|
||||
this.handleLaunchPermissionsEditor(isMe ? 'want' : 'user', params.topicName);
|
||||
}
|
||||
handler: _ => this.handleLaunchPermissionsEditor(isMe ? 'want' : 'user', params.topicName)
|
||||
}];
|
||||
if (!isMe) {
|
||||
menuItems.push('member_delete');
|
||||
@@ -5850,7 +5846,7 @@ class MessagesView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
|
||||
}
|
||||
const oldTopic = this.props.tinode.getTopic(oldTopicName);
|
||||
if (oldTopic && oldTopic.isSubscribed()) {
|
||||
oldTopic.leave(false).catch(() => {}).finally(() => {
|
||||
oldTopic.leave(false).catch(_ => {}).finally(_ => {
|
||||
this.setState({
|
||||
fetchingMessages: false
|
||||
});
|
||||
@@ -5886,8 +5882,8 @@ class MessagesView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
|
||||
if (topic && topic.isSubscribed() && topic.msgHasMoreMessages()) {
|
||||
this.setState({
|
||||
fetchingMessages: true
|
||||
}, () => {
|
||||
topic.getMessagesPage(_config_js__WEBPACK_IMPORTED_MODULE_16__.MESSAGES_PAGE).catch(err => this.props.onError(err.message, 'err')).finally(() => this.setState({
|
||||
}, _ => {
|
||||
topic.getMessagesPage(_config_js__WEBPACK_IMPORTED_MODULE_16__.MESSAGES_PAGE).catch(err => this.props.onError(err.message, 'err')).finally(_ => this.setState({
|
||||
fetchingMessages: false
|
||||
}));
|
||||
});
|
||||
@@ -6042,11 +6038,9 @@ class MessagesView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
|
||||
case 'kp':
|
||||
{
|
||||
clearTimeout(this.keyPressTimer);
|
||||
this.keyPressTimer = setTimeout(() => {
|
||||
this.setState({
|
||||
typingIndicator: false
|
||||
});
|
||||
}, _config_js__WEBPACK_IMPORTED_MODULE_16__.KEYPRESS_DELAY + 1000);
|
||||
this.keyPressTimer = setTimeout(_ => this.setState({
|
||||
typingIndicator: false
|
||||
}), _config_js__WEBPACK_IMPORTED_MODULE_16__.KEYPRESS_DELAY + 1000);
|
||||
if (!this.state.typingIndicator) {
|
||||
this.setState({
|
||||
typingIndicator: true
|
||||
@@ -6261,9 +6255,7 @@ class MessagesView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
|
||||
msg = tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Drafty.append(msg, tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Drafty.parse(caption));
|
||||
}
|
||||
this.sendMessage(msg, uploadCompletionPromise, uploader);
|
||||
}).catch(err => {
|
||||
this.props.onError(err, 'err');
|
||||
});
|
||||
}).catch(err => this.props.onError(err, 'err'));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -6947,11 +6939,9 @@ class PasswordResetView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Pu
|
||||
this.setState({
|
||||
email: email
|
||||
});
|
||||
this.props.onRequest('email', email).then(() => {
|
||||
this.setState({
|
||||
sent: true
|
||||
});
|
||||
});
|
||||
this.props.onRequest('email', email).then(_ => this.setState({
|
||||
sent: true
|
||||
}));
|
||||
}
|
||||
}
|
||||
handleEmailChange(e) {
|
||||
@@ -7800,7 +7790,7 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
||||
if (this.state.desktopAlerts) {
|
||||
this.tinode.setDeviceToken(this.state.firebaseToken);
|
||||
}
|
||||
}).catch(() => {
|
||||
}).catch(_ => {
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -7956,9 +7946,9 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
||||
}
|
||||
|
||||
checkForAppUpdate(reg) {
|
||||
reg.onupdatefound = () => {
|
||||
reg.onupdatefound = _ => {
|
||||
const installingWorker = reg.installing;
|
||||
installingWorker.onstatechange = () => {
|
||||
installingWorker.onstatechange = _ => {
|
||||
if (installingWorker.state == 'installed' && navigator.serviceWorker.controller) {
|
||||
const msg = react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__.FormattedMessage, {
|
||||
id: "update_available",
|
||||
@@ -8084,14 +8074,14 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
||||
|
||||
handlePersistenceChange(persist) {
|
||||
if (persist) {
|
||||
this.tinode.initStorage().then(() => {
|
||||
this.tinode.initStorage().then(_ => {
|
||||
_lib_local_storage_js__WEBPACK_IMPORTED_MODULE_17__["default"].setObject('keep-logged-in', true);
|
||||
this.setState({
|
||||
persist: true
|
||||
});
|
||||
});
|
||||
} else {
|
||||
this.tinode.clearStorage().then(() => {
|
||||
this.tinode.clearStorage().then(_ => {
|
||||
_lib_local_storage_js__WEBPACK_IMPORTED_MODULE_17__["default"].setObject('keep-logged-in', false);
|
||||
this.setState({
|
||||
persist: false
|
||||
@@ -8250,7 +8240,7 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
||||
localStorage.removeItem('auth-token');
|
||||
this.handleError(err.message, 'err');
|
||||
_lib_navigation_js__WEBPACK_IMPORTED_MODULE_18__["default"].navigateTo('');
|
||||
}).finally(() => {
|
||||
}).finally(_ => {
|
||||
this.setState({
|
||||
loadSpinnerVisible: false
|
||||
});
|
||||
@@ -8407,11 +8397,7 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
||||
desc: {
|
||||
public: query
|
||||
}
|
||||
}).then(ctrl => {
|
||||
return fnd.getMeta(fnd.startMetaQuery().withSub().build());
|
||||
}).catch(err => {
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
}).then(_ => fnd.getMeta(fnd.startMetaQuery().withSub().build())).catch(err => this.handleError(err.message, 'err'));
|
||||
}
|
||||
|
||||
handleTopicSelected(topicName) {
|
||||
@@ -8471,7 +8457,7 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
||||
completion.push(uploadCompletionPromise);
|
||||
}
|
||||
if (!topic.isSubscribed()) {
|
||||
const subscribePromise = topic.subscribe().then(() => {
|
||||
const subscribePromise = topic.subscribe().then(_ => {
|
||||
let calls = [];
|
||||
topic.queuedMessages(pub => {
|
||||
if (pub._sending || pub.seq == msg.seq) {
|
||||
@@ -8497,9 +8483,7 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
||||
topic.archive(false);
|
||||
}
|
||||
return ctrl;
|
||||
}).catch(err => {
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
}).catch(err => this.handleError(err.message, 'err'));
|
||||
}
|
||||
handleNewChatInvitation(topicName, action) {
|
||||
const topic = this.tinode.getTopic(topicName);
|
||||
@@ -8513,14 +8497,12 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
||||
}
|
||||
});
|
||||
if (topic.isP2PType()) {
|
||||
response = response.then(ctrl => {
|
||||
topic.setMeta({
|
||||
sub: {
|
||||
user: topicName,
|
||||
mode: mode
|
||||
}
|
||||
});
|
||||
});
|
||||
response = response.then(_ => topic.setMeta({
|
||||
sub: {
|
||||
user: topicName,
|
||||
mode: mode
|
||||
}
|
||||
}));
|
||||
}
|
||||
break;
|
||||
case 'delete':
|
||||
@@ -8532,17 +8514,13 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
||||
sub: {
|
||||
mode: am
|
||||
}
|
||||
}).then(ctrl => {
|
||||
return this.handleTopicSelected(null);
|
||||
});
|
||||
}).then(_ => this.handleTopicSelected(null));
|
||||
break;
|
||||
default:
|
||||
console.warn("Unknown invitation action", '"' + action + '""');
|
||||
}
|
||||
if (response != null) {
|
||||
response.catch(err => {
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
response.catch(err => this.handleError(err.message, 'err'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8594,9 +8572,7 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
||||
handleUpdateAccountTagsRequest(tags) {
|
||||
this.tinode.getMeTopic().setMeta({
|
||||
tags: tags
|
||||
}).catch(err => {
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
}).catch(err => this.handleError(err.message, 'err'));
|
||||
}
|
||||
|
||||
handleSettings() {
|
||||
@@ -8659,7 +8635,7 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
||||
} else if (this.state.firebaseToken && this.fcm) {
|
||||
(0,firebase_messaging__WEBPACK_IMPORTED_MODULE_3__.deleteToken)(this.fcm).catch(err => {
|
||||
console.error("Unable to delete token.", err);
|
||||
}).finally(() => {
|
||||
}).finally(_ => {
|
||||
_lib_local_storage_js__WEBPACK_IMPORTED_MODULE_17__["default"].updateObject('settings', {
|
||||
desktopAlerts: false
|
||||
});
|
||||
@@ -8695,15 +8671,11 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
||||
meth: method,
|
||||
val: value
|
||||
}
|
||||
}).catch(err => {
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
}).catch(err => this.handleError(err.message, 'err'));
|
||||
}
|
||||
handleCredDelete(method, value) {
|
||||
const me = this.tinode.getMeTopic();
|
||||
me.delCredential(method, value).catch(err => {
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
me.delCredential(method, value).catch(err => this.handleError(err.message, 'err'));
|
||||
}
|
||||
handleCredConfirm(method, response) {
|
||||
TinodeWeb.navigateToCredentialsView({
|
||||
@@ -8776,7 +8748,7 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
||||
params._topicName = topicName;
|
||||
this.setState({
|
||||
newTopicParams: params
|
||||
}, () => {
|
||||
}, _ => {
|
||||
this.handleTopicSelected(topicName);
|
||||
});
|
||||
}
|
||||
@@ -8823,25 +8795,19 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
||||
topic.setMeta({
|
||||
desc: params,
|
||||
attachments: attachments
|
||||
}).catch(err => {
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
}).catch(err => this.handleError(err.message, 'err'));
|
||||
}
|
||||
}
|
||||
handleUnarchive(topicName) {
|
||||
const topic = this.tinode.getTopic(topicName);
|
||||
if (topic) {
|
||||
topic.archive(false).catch(err => {
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
topic.archive(false).catch(err => this.handleError(err.message, 'err'));
|
||||
}
|
||||
}
|
||||
handleUpdatePasswordRequest(password) {
|
||||
this.handleError();
|
||||
if (password) {
|
||||
this.tinode.updateAccountBasic(null, this.tinode.getCurrentLogin(), password).catch(err => {
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
this.tinode.updateAccountBasic(null, this.tinode.getCurrentLogin(), password).catch(err => this.handleError(err.message, 'err'));
|
||||
}
|
||||
}
|
||||
handleChangePermissions(topicName, mode, uid) {
|
||||
@@ -8860,9 +8826,7 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
||||
user: uid,
|
||||
mode: mode
|
||||
}
|
||||
}).catch(err => {
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
}).catch(err => this.handleError(err.message, 'err'));
|
||||
}
|
||||
}
|
||||
handleTagsUpdateRequest(topicName, tags) {
|
||||
@@ -8870,9 +8834,7 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
||||
if (topic) {
|
||||
topic.setMeta({
|
||||
tags: tags
|
||||
}).catch(err => {
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
}).catch(err => this.handleError(err.message, 'err'));
|
||||
}
|
||||
}
|
||||
handleLogout() {
|
||||
@@ -8894,8 +8856,8 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
||||
cleared = Promose.resolve();
|
||||
}
|
||||
this.setState(this.getBlankState());
|
||||
cleared.then(() => {
|
||||
this.tinode = TinodeWeb.tnSetup(this.state.serverAddress, (0,_lib_host_name_js__WEBPACK_IMPORTED_MODULE_16__.isSecureConnection)(), this.state.transport, this.props.intl.locale, _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_17__["default"].getObject('keep-logged-in'), () => {
|
||||
cleared.then(_ => {
|
||||
this.tinode = TinodeWeb.tnSetup(this.state.serverAddress, (0,_lib_host_name_js__WEBPACK_IMPORTED_MODULE_16__.isSecureConnection)(), this.state.transport, this.props.intl.locale, _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_17__["default"].getObject('keep-logged-in'), _ => {
|
||||
this.tinode.onConnect = this.handleConnected;
|
||||
this.tinode.onDisconnect = this.handleDisconnect;
|
||||
this.tinode.onAutoreconnectIteration = this.handleAutoreconnectIteration;
|
||||
@@ -8916,7 +8878,7 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
||||
return;
|
||||
}
|
||||
|
||||
topic.delTopic(true).then(ctrl => {
|
||||
topic.delTopic(true).then(_ => {
|
||||
_lib_navigation_js__WEBPACK_IMPORTED_MODULE_18__["default"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_18__["default"].setUrlTopic(window.location.hash, ''));
|
||||
}).catch(err => {
|
||||
this.handleError(err.message, 'err');
|
||||
@@ -8928,16 +8890,14 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
||||
return;
|
||||
}
|
||||
|
||||
topic.delMessagesAll(true).catch(err => {
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
topic.delMessagesAll(true).catch(err => this.handleError(err.message, 'err'));
|
||||
}
|
||||
handleLeaveUnsubRequest(topicName) {
|
||||
const topic = this.tinode.getTopic(topicName);
|
||||
if (!topic) {
|
||||
return;
|
||||
}
|
||||
topic.leave(true).then(ctrl => {
|
||||
topic.leave(true).then(_ => {
|
||||
_lib_navigation_js__WEBPACK_IMPORTED_MODULE_18__["default"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_18__["default"].setUrlTopic(window.location.hash, ''));
|
||||
}).catch(err => {
|
||||
this.handleError(err.message, 'err');
|
||||
@@ -8950,9 +8910,7 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
||||
}
|
||||
topic.updateMode(null, '-JP').then(_ => {
|
||||
_lib_navigation_js__WEBPACK_IMPORTED_MODULE_18__["default"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_18__["default"].setUrlTopic(window.location.hash, ''));
|
||||
}).catch(err => {
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
}).catch(err => this.handleError(err.message, 'err'));
|
||||
}
|
||||
handleReportTopic(topicName) {
|
||||
const topic = this.tinode.getTopic(topicName);
|
||||
@@ -8962,11 +8920,9 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
||||
|
||||
this.tinode.report('report', topicName);
|
||||
|
||||
topic.updateMode(null, '-JP').then(ctrl => {
|
||||
topic.updateMode(null, '-JP').then(_ => {
|
||||
_lib_navigation_js__WEBPACK_IMPORTED_MODULE_18__["default"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_18__["default"].setUrlTopic(window.location.hash, ''));
|
||||
}).catch(err => {
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
}).catch(err => this.handleError(err.message, 'err'));
|
||||
}
|
||||
handleShowContextMenu(params, menuItems) {
|
||||
this.setState({
|
||||
@@ -9051,7 +9007,7 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
||||
handleContextMenuAction(action, promise, params) {
|
||||
if (action == 'topic_archive') {
|
||||
if (promise && params.topicName && params.topicName == this.state.topicSelected) {
|
||||
promise.then(() => {
|
||||
promise.then(_ => {
|
||||
this.handleTopicSelected(null);
|
||||
});
|
||||
}
|
||||
@@ -9088,16 +9044,12 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
||||
}
|
||||
if (added && added.length > 0) {
|
||||
added.map(uid => {
|
||||
topic.invite(uid, null).catch(err => {
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
topic.invite(uid, null).catch(err => this.handleError(err.message, 'err'));
|
||||
});
|
||||
}
|
||||
if (removed && removed.length > 0) {
|
||||
removed.map(uid => {
|
||||
topic.delSubscription(uid).catch(err => {
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
topic.delSubscription(uid).catch(err => this.handleError(err.message, 'err'));
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -9108,9 +9060,7 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
||||
meth: cred,
|
||||
resp: code
|
||||
}
|
||||
}).catch(err => {
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
}).catch(err => this.handleError(err.message, 'err'));
|
||||
} else {
|
||||
this.setState({
|
||||
credMethod: cred,
|
||||
@@ -9124,9 +9074,7 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
||||
}
|
||||
}
|
||||
handlePasswordResetRequest(method, value) {
|
||||
return this.tinode.connect().then(() => {
|
||||
return this.tinode.requestResetAuthSecret('basic', method, value);
|
||||
}).catch(err => {
|
||||
return this.tinode.connect().then(_ => this.tinode.requestResetAuthSecret('basic', method, value)).catch(err => {
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
}
|
||||
@@ -9135,13 +9083,9 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
||||
if (!token) {
|
||||
this.handleError(this.props.intl.formatMessage(messages.invalid_security_token), 'err');
|
||||
} else {
|
||||
this.tinode.connect().then(() => {
|
||||
return this.tinode.updateAccountBasic(null, null, newPassword, {
|
||||
token: token
|
||||
});
|
||||
}).then(() => {
|
||||
_lib_navigation_js__WEBPACK_IMPORTED_MODULE_18__["default"].navigateTo('');
|
||||
}).catch(err => {
|
||||
this.tinode.connect().then(_ => this.tinode.updateAccountBasic(null, null, newPassword, {
|
||||
token: token
|
||||
})).then(_ => _lib_navigation_js__WEBPACK_IMPORTED_MODULE_18__["default"].navigateTo('')).catch(err => {
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
}
|
||||
@@ -9234,7 +9178,7 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
||||
} else {
|
||||
this.setState({
|
||||
callShouldStart: true
|
||||
}, () => this.handleTopicSelected(this.state.callTopic));
|
||||
}, _ => this.handleTopicSelected(this.state.callTopic));
|
||||
}
|
||||
}
|
||||
handleInfoMessage(info) {
|
||||
@@ -9327,13 +9271,11 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
||||
visible: this.state.alertVisible,
|
||||
title: this.state.alertParams.title,
|
||||
content: this.state.alertParams.content,
|
||||
onReject: this.state.alertParams.onReject ? () => {
|
||||
this.setState({
|
||||
alertVisible: false
|
||||
});
|
||||
} : null,
|
||||
onReject: this.state.alertParams.onReject ? _ => this.setState({
|
||||
alertVisible: false
|
||||
}) : null,
|
||||
reject: this.state.alertParams.reject,
|
||||
onConfirm: () => {
|
||||
onConfirm: _ => {
|
||||
this.setState({
|
||||
alertVisible: false
|
||||
});
|
||||
@@ -9737,18 +9679,12 @@ class Attachment extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component
|
||||
this.setState({
|
||||
downloader: downloader
|
||||
});
|
||||
downloader.download(url, filename, mimetype, loaded => {
|
||||
this.setState({
|
||||
progress: loaded / this.props.size
|
||||
});
|
||||
}, err => {
|
||||
this.props.onError(err, 'err');
|
||||
}).then(() => {
|
||||
this.setState({
|
||||
downloader: null,
|
||||
progress: 0
|
||||
});
|
||||
}).catch(err => {
|
||||
downloader.download(url, filename, mimetype, loaded => this.setState({
|
||||
progress: loaded / this.props.size
|
||||
}), err => this.props.onError(err, 'err')).then(_ => this.setState({
|
||||
downloader: null,
|
||||
progress: 0
|
||||
})).catch(err => {
|
||||
if (err) {
|
||||
this.props.onError("Error downloading file: " + err.message, 'err');
|
||||
}
|
||||
@@ -9931,7 +9867,7 @@ class AudioPlayer extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureComp
|
||||
const width = this.effectiveWidth;
|
||||
const height = this.canvasRef.current.height;
|
||||
this.canvasContext.lineWidth = LINE_WIDTH;
|
||||
const drawFrame = () => {
|
||||
const drawFrame = _ => {
|
||||
if (!this.canvasRef.current || !this.audioPlayer) {
|
||||
return;
|
||||
}
|
||||
@@ -10160,7 +10096,7 @@ class AudioRecorder extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureCo
|
||||
let prevBarCount = 0;
|
||||
let volume = 0.0;
|
||||
let countPerBar = 0;
|
||||
const drawFrame = () => {
|
||||
const drawFrame = _ => {
|
||||
if (!this.startedOn) {
|
||||
return;
|
||||
}
|
||||
@@ -11145,7 +11081,7 @@ class CallPanel extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureCompon
|
||||
this.state.pc.setRemoteDescription(desc).then(_ => {
|
||||
this.setState({
|
||||
callInitialSetupComplete: true
|
||||
}, () => this.drainRemoteIceCandidatesCache());
|
||||
}, _ => this.drainRemoteIceCandidatesCache());
|
||||
}).catch(this.reportError);
|
||||
}
|
||||
reportError(err) {
|
||||
@@ -11245,7 +11181,7 @@ class CallPanel extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureCompon
|
||||
this.props.onSendAnswer(this.props.topic, this.props.seq, pc.localDescription.toJSON());
|
||||
this.setState({
|
||||
callInitialSetupComplete: true
|
||||
}, () => this.drainRemoteIceCandidatesCache());
|
||||
}, _ => this.drainRemoteIceCandidatesCache());
|
||||
}).catch(this.handleGetUserMediaError);
|
||||
}
|
||||
|
||||
@@ -12614,7 +12550,7 @@ class ContextMenu extends (react__WEBPACK_IMPORTED_MODULE_0___default().Componen
|
||||
'menu_item_forward': {
|
||||
id: 'menu_item_forward',
|
||||
title: formatMessage(messages.forward),
|
||||
handler: () => {}
|
||||
handler: _ => {}
|
||||
},
|
||||
|
||||
'menu_item_edit': {
|
||||
@@ -12645,12 +12581,10 @@ class ContextMenu extends (react__WEBPACK_IMPORTED_MODULE_0___default().Componen
|
||||
handler: (params, errorHandler) => {
|
||||
return props.onShowAlert(formatMessage(messages.block),
|
||||
formatMessage(messages.topic_block_warning),
|
||||
() => {
|
||||
return this.topicPermissionSetter('-JP', params, errorHandler).then(ctrl => {
|
||||
this.props.onTopicRemoved(params.topicName);
|
||||
return ctrl;
|
||||
});
|
||||
}, null,
|
||||
_ => this.topicPermissionSetter('-JP', params, errorHandler).then(ctrl => {
|
||||
this.props.onTopicRemoved(params.topicName);
|
||||
return ctrl;
|
||||
}), null,
|
||||
true,
|
||||
null);
|
||||
}
|
||||
@@ -12662,7 +12596,7 @@ class ContextMenu extends (react__WEBPACK_IMPORTED_MODULE_0___default().Componen
|
||||
handler: (params, errorHandler) => {
|
||||
return props.onShowAlert(formatMessage(messages.topic_delete),
|
||||
formatMessage(messages.topic_delete_warning),
|
||||
() => {
|
||||
_ => {
|
||||
const topic = this.props.tinode.getTopic(params.topicName);
|
||||
if (!topic) {
|
||||
console.warn("Topic not found: ", params.topicName);
|
||||
@@ -12829,9 +12763,7 @@ class ContextMenu extends (react__WEBPACK_IMPORTED_MODULE_0___default().Componen
|
||||
}
|
||||
let result = topic.updateMode(params.user, mode);
|
||||
if (errorHandler) {
|
||||
result = result.catch(err => {
|
||||
errorHandler(err.message, 'err');
|
||||
});
|
||||
result = result.catch(err => errorHandler(err.message, 'err'));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -14052,7 +13984,7 @@ class InPlaceEdit extends (react__WEBPACK_IMPORTED_MODULE_0___default().Componen
|
||||
if (!this.props.readOnly) {
|
||||
this.setState({
|
||||
active: true
|
||||
}, () => {
|
||||
}, _ => {
|
||||
if (this.selfRef.current) {
|
||||
this.selfRef.current.focus();
|
||||
}
|
||||
@@ -14248,7 +14180,7 @@ class LazyImage extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureCompon
|
||||
...this.state.style,
|
||||
padding: 0
|
||||
}
|
||||
})).catch(() => this.setState({
|
||||
})).catch(_ => this.setState({
|
||||
src: 'img/broken_image.png'
|
||||
}));
|
||||
}
|
||||
@@ -14270,7 +14202,7 @@ class LazyImage extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureCompon
|
||||
...this.state.style,
|
||||
padding: 0
|
||||
}
|
||||
})).catch(() => this.setState({
|
||||
})).catch(_ => this.setState({
|
||||
src: 'img/broken_image.png'
|
||||
}));
|
||||
}
|
||||
@@ -16549,9 +16481,7 @@ class TopicSecurity extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureCo
|
||||
} = this.props.intl;
|
||||
this.props.onShowAlert(formatMessage(messages.topic_delete),
|
||||
formatMessage(messages.topic_delete_warning),
|
||||
() => {
|
||||
this.props.onDeleteTopic(this.props.topic);
|
||||
},
|
||||
_ => this.props.onDeleteTopic(this.props.topic),
|
||||
null,
|
||||
true,
|
||||
null);
|
||||
@@ -16564,9 +16494,7 @@ class TopicSecurity extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureCo
|
||||
} = this.props.intl;
|
||||
this.props.onShowAlert(formatMessage(this.props.deleter ? messages.delete_messages : messages.clear_messages),
|
||||
formatMessage(this.props.deleter ? messages.delete_messages_warning : messages.clear_messages_warning),
|
||||
() => {
|
||||
this.props.onDeleteMessages(this.props.topic);
|
||||
},
|
||||
_ => this.props.onDeleteMessages(this.props.topic),
|
||||
null,
|
||||
true,
|
||||
null);
|
||||
@@ -16579,9 +16507,7 @@ class TopicSecurity extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureCo
|
||||
} = this.props.intl;
|
||||
this.props.onShowAlert(formatMessage(messages.leave_chat),
|
||||
formatMessage(messages.leave_chat_warning),
|
||||
() => {
|
||||
this.props.onLeaveTopic(this.props.topic);
|
||||
},
|
||||
_ => this.props.onLeaveTopic(this.props.topic),
|
||||
null,
|
||||
true,
|
||||
null);
|
||||
@@ -16594,9 +16520,7 @@ class TopicSecurity extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureCo
|
||||
} = this.props.intl;
|
||||
this.props.onShowAlert(formatMessage(messages.block_contact),
|
||||
formatMessage(messages.block_contact_warning),
|
||||
() => {
|
||||
this.props.onBlockTopic(this.props.topic);
|
||||
},
|
||||
_ => this.props.onBlockTopic(this.props.topic),
|
||||
null,
|
||||
true,
|
||||
null);
|
||||
@@ -16867,7 +16791,7 @@ class VisiblePassword extends (react__WEBPACK_IMPORTED_MODULE_0___default().Pure
|
||||
handleEditingFinished(e) {
|
||||
if (e) {
|
||||
let currentTarget = e.currentTarget;
|
||||
setTimeout(() => {
|
||||
setTimeout(_ => {
|
||||
if (!currentTarget.contains(document.activeElement)) {
|
||||
if (this.props.onFinished) {
|
||||
this.props.onFinished(this.state.value);
|
||||
|
||||
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user