1
0
mirror of https://github.com/element-hq/element-web.git synced 2025-11-29 21:23:11 +03:00

type Actions (#7862)

* type ViewHomPage action

Signed-off-by: Kerry Archibald <kerrya@element.io>

* type spacestore actions

Signed-off-by: Kerry Archibald <kerrya@element.io>

* lint

Signed-off-by: Kerry Archibald <kerrya@element.io>

* add action types

Signed-off-by: Kerry Archibald <kerrya@element.io>

* use new action types in stores

Signed-off-by: Kerry Archibald <kerrya@element.io>

* remove debug change

Signed-off-by: Kerry Archibald <kerrya@element.io>

* stricter keyboard shortcut types

Signed-off-by: Kerry Archibald <kerrya@element.io>

* action comments

Signed-off-by: Kerry Archibald <kerrya@element.io>
This commit is contained in:
Kerry
2022-02-22 11:04:27 +01:00
committed by GitHub
parent 57595bc593
commit 5b8d440406
33 changed files with 304 additions and 73 deletions

View File

@@ -103,6 +103,7 @@ import { ActionPayload } from "../../dispatcher/payloads";
import { KeyBindingAction } from "../../accessibility/KeyboardShortcuts";
import { ViewRoomPayload } from "../../dispatcher/payloads/ViewRoomPayload";
import { JoinRoomPayload } from "../../dispatcher/payloads/JoinRoomPayload";
import { DoAfterSyncPreparedPayload } from '../../dispatcher/payloads/DoAfterSyncPreparedPayload';
const DEBUG = false;
let debuglog = function(msg: string) {};
@@ -1273,11 +1274,12 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
if (this.context && this.context.isGuest()) {
// Join this room once the user has registered and logged in
// (If we failed to peek, we may not have a valid room object.)
dis.dispatch({
action: 'do_after_sync_prepared',
dis.dispatch<DoAfterSyncPreparedPayload<ViewRoomPayload>>({
action: Action.DoAfterSyncPrepared,
deferred_action: {
action: Action.ViewRoom,
room_id: this.getRoomId(),
metricsTrigger: undefined,
},
});
dis.dispatch({ action: 'require_registration' });
@@ -1568,7 +1570,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
rejecting: true,
});
this.context.leave(this.state.roomId).then(() => {
dis.dispatch({ action: 'view_home_page' });
dis.dispatch({ action: Action.ViewHomePage });
this.setState({
rejecting: false,
});
@@ -1601,7 +1603,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
await this.context.setIgnoredUsers(ignoredUsers);
await this.context.leave(this.state.roomId);
dis.dispatch({ action: 'view_home_page' });
dis.dispatch({ action: Action.ViewHomePage });
this.setState({
rejecting: false,
});