mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-15 01:41:31 +03:00
pass ev to handleConfetti in order to check content before dispatch
This commit is contained in:
parent
eef654e0e3
commit
d41ffb1b4b
1 changed files with 6 additions and 4 deletions
|
@ -57,7 +57,7 @@ import MatrixClientContext from "../../contexts/MatrixClientContext";
|
||||||
import { shieldStatusForRoom } from '../../utils/ShieldUtils';
|
import { shieldStatusForRoom } from '../../utils/ShieldUtils';
|
||||||
import {Action} from "../../dispatcher/actions";
|
import {Action} from "../../dispatcher/actions";
|
||||||
import {SettingLevel} from "../../settings/SettingLevel";
|
import {SettingLevel} from "../../settings/SettingLevel";
|
||||||
import {animateConfetti, forceStopConfetti} from "../views/elements/Confetti";
|
import {animateConfetti, forceStopConfetti, isConfettiEmoji} from "../views/elements/Confetti";
|
||||||
|
|
||||||
const DEBUG = false;
|
const DEBUG = false;
|
||||||
let debuglog = function() {};
|
let debuglog = function() {};
|
||||||
|
@ -758,12 +758,14 @@ export default createReactClass({
|
||||||
},
|
},
|
||||||
onEventDecrypted(ev) {
|
onEventDecrypted(ev) {
|
||||||
if (ev.isBeingDecrypted() || ev.isDecryptionFailure()) return;
|
if (ev.isBeingDecrypted() || ev.isDecryptionFailure()) return;
|
||||||
this.handleConfetti();
|
this.handleConfetti(ev);
|
||||||
},
|
},
|
||||||
handleConfetti() {
|
handleConfetti(ev) {
|
||||||
if (this.context.isInitialSyncComplete()) {
|
if (this.context.isInitialSyncComplete()) {
|
||||||
|
if (isConfettiEmoji(ev.getContent())) {
|
||||||
dis.dispatch({action: 'confetti'});
|
dis.dispatch({action: 'confetti'});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onRoomName: function(room) {
|
onRoomName: function(room) {
|
||||||
|
|
Loading…
Reference in a new issue