Revert "Replace Promise.delay with promise utils sleep"

This reverts commit 0a21957b
This commit is contained in:
Michael Telatynski 2019-11-12 11:56:32 +00:00
parent 168b1b68bb
commit f9d6ed63f0
4 changed files with 9 additions and 13 deletions

View file

@ -32,7 +32,6 @@ import * as RoomNotifs from '../../../RoomNotifs';
import Modal from '../../../Modal';
import RoomListActions from '../../../actions/RoomListActions';
import RoomViewStore from '../../../stores/RoomViewStore';
import {sleep} from "../../../utils/promise";
module.exports = createReactClass({
displayName: 'RoomTileContextMenu',
@ -63,7 +62,7 @@ module.exports = createReactClass({
_toggleTag: function(tagNameOn, tagNameOff) {
if (!MatrixClientPeg.get().isGuest()) {
sleep(500).then(() => {
Promise.delay(500).then(() => {
dis.dispatch(RoomListActions.tagRoom(
MatrixClientPeg.get(),
this.props.room,
@ -120,7 +119,7 @@ module.exports = createReactClass({
Rooms.guessAndSetDMRoom(
this.props.room, newIsDirectMessage,
).then(sleep(500)).finally(() => {
).delay(500).finally(() => {
// Close the context menu
if (this.props.onFinished) {
this.props.onFinished();
@ -194,7 +193,7 @@ module.exports = createReactClass({
RoomNotifs.setRoomNotifsState(roomId, newState).done(() => {
// delay slightly so that the user can see their state change
// before closing the menu
return sleep(500).then(() => {
return Promise.delay(500).then(() => {
if (this._unmounted) return;
// Close the context menu
if (this.props.onFinished) {