mirror of
https://github.com/vector-im/element-web.git
synced 2025-12-07 18:31:33 +01:00
Add 500ms delay to show membershipBusy for longer
to avoid a UI that flashes quickly
This commit is contained in:
parent
74c84addea
commit
31e9979285
@ -670,8 +670,12 @@ export default React.createClass({
|
||||
});
|
||||
},
|
||||
|
||||
_onAcceptInviteClick: function() {
|
||||
_onAcceptInviteClick: async function() {
|
||||
this.setState({membershipBusy: true});
|
||||
|
||||
// Wait 500ms to prevent flashing
|
||||
await Promise.delay(500);
|
||||
|
||||
this._groupStore.acceptGroupInvite().then(() => {
|
||||
// don't reset membershipBusy here: wait for the membership change to come down the sync
|
||||
}).catch((e) => {
|
||||
@ -684,8 +688,12 @@ export default React.createClass({
|
||||
});
|
||||
},
|
||||
|
||||
_onRejectInviteClick: function() {
|
||||
_onRejectInviteClick: async function() {
|
||||
this.setState({membershipBusy: true});
|
||||
|
||||
// Wait 500ms to prevent flashing
|
||||
await Promise.delay(500);
|
||||
|
||||
this._groupStore.leaveGroup().then(() => {
|
||||
// don't reset membershipBusy here: wait for the membership change to come down the sync
|
||||
}).catch((e) => {
|
||||
@ -698,9 +706,12 @@ export default React.createClass({
|
||||
});
|
||||
},
|
||||
|
||||
_onJoinClick: function() {
|
||||
_onJoinClick: async function() {
|
||||
this.setState({membershipBusy: true});
|
||||
|
||||
// Wait 500ms to prevent flashing
|
||||
await Promise.delay(500);
|
||||
|
||||
this._groupStore.joinGroup().then(() => {
|
||||
// don't reset membershipBusy here: wait for the membership change to come down the sync
|
||||
}).catch((e) => {
|
||||
@ -720,10 +731,14 @@ export default React.createClass({
|
||||
description: _t("Leave %(groupName)s?", {groupName: this.props.groupId}),
|
||||
button: _t("Leave"),
|
||||
danger: true,
|
||||
onFinished: (confirmed) => {
|
||||
onFinished: async (confirmed) => {
|
||||
if (!confirmed) return;
|
||||
|
||||
this.setState({membershipBusy: true});
|
||||
|
||||
// Wait 500ms to prevent flashing
|
||||
await Promise.delay(500);
|
||||
|
||||
this._groupStore.leaveGroup().then(() => {
|
||||
// don't reset membershipBusy here: wait for the membership change to come down the sync
|
||||
}).catch((e) => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user