How to use the matrix-react-sdk/lib/dispatcher.register function in matrix-react-sdk

To help you get started, we’ve selected a few matrix-react-sdk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vector-im / riot-web / src / components / structures / login / Registration.js View on Github external
componentWillMount: function() {
        this.dispatcherRef = dis.register(this.onAction);
        // attach this to the instance rather than this.state since it isn't UI
        this.registerLogic = new Signup.Register(
            this.props.hsUrl, this.props.isUrl
        );
        this.registerLogic.setClientSecret(this.props.clientSecret);
        this.registerLogic.setSessionId(this.props.sessionId);
        this.registerLogic.setRegistrationUrl(this.props.registrationUrl);
        this.registerLogic.setIdSid(this.props.idSid);
        this.registerLogic.recheckState();
    },
github vector-im / riot-web / src / vector / platform / ElectronPlatform.js View on Github external
constructor() {
        super();

        this._pendingIpcCalls = {};
        this._nextIpcCallId = 0;
        this.eventIndexManager = new SeshatIndexManager();

        dis.register(_onAction);
        /*
            IPC Call `check_updates` returns:
            true if there is an update available
            false if there is not
            or the error if one is encountered
         */
        ipcRenderer.on('check_updates', (event, status) => {
            if (!this.showUpdateCheck) return;
            dis.dispatch({
                action: 'check_updates',
                value: getUpdateCheckStatus(status),
            });
            this.showUpdateCheck = false;
        });

        // try to flush the rageshake logs to indexeddb before quit.
github vector-im / riot-web / test / app-tests / loading.js View on Github external
return new Promise(resolve => {
        const onAction = ({ action }) => {
            if (action !== "on_logged_in") {
                return;
            }
            console.log(Date.now() + ": Received on_logged_in action");
            dis.unregister(dispatcherRef);
            resolve();
        };
        const dispatcherRef = dis.register(onAction);
        console.log(Date.now() + ": Waiting for on_logged_in action");
    });
}
github vector-im / riot-web / src / controllers / molecules / voip / CallView.js View on Github external
componentDidMount: function() {
        this.dispatcherRef = dis.register(this.onAction);
        this._trackedRoom = null;
        if (this.props.room) {
            this._trackedRoom = this.props.room;
            this.showCall(this._trackedRoom.roomId);
        }
        else {
            var call = CallHandler.getAnyActiveCall();
            if (call) {
                console.log(
                    "Global CallView is now tracking active call in room %s",
                    call.roomId
                );
                this._trackedRoom = MatrixClientPeg.get().getRoom(call.roomId);
                this.showCall(call.roomId);
            }
        }
github vector-im / riot-web / src / components / structures / RightPanel.js View on Github external
componentWillMount: function() {
        this.dispatcherRef = dis.register(this.onAction);
        var cli = MatrixClientPeg.get();
        cli.on("RoomState.members", this.onRoomStateMember);
    },
github vector-im / riot-web / src / controllers / organisms / RoomView.js View on Github external
componentWillMount: function() {
        this.dispatcherRef = dis.register(this.onAction);
        MatrixClientPeg.get().on("Room.timeline", this.onRoomTimeline);
        MatrixClientPeg.get().on("Room.name", this.onRoomName);
        MatrixClientPeg.get().on("Room.receipt", this.onRoomReceipt);
        MatrixClientPeg.get().on("RoomMember.typing", this.onRoomMemberTyping);
        MatrixClientPeg.get().on("RoomState.members", this.onRoomStateMember);
        MatrixClientPeg.get().on("sync", this.onSyncStateChange);
        this.atBottom = true;
    },
github vector-im / riot-web / src / controllers / organisms / RoomList.js View on Github external
componentDidMount: function() {
        this.dispatcherRef = dis.register(this.onAction);
    },
github vector-im / riot-web / src / components / structures / BottomLeftMenu.js View on Github external
componentWillMount: function() {
        this._dispatcherRef = dis.register(this.onAction);
        this._peopleButton = null;
        this._directoryButton = null;
        this._createRoomButton = null;
        this._lastCallouts = {};
    },
github vector-im / riot-web / src / components / views / settings / IntegrationsManager.js View on Github external
componentDidMount: function() {
        this.dispatcherRef = dis.register(this.onAction);
        document.addEventListener("keydown", this.onKeyDown);
    },