Add optional mobile guide toast

This adds an optional toast which Element deployments can enable to nudge users
towards the mobile apps once they are inside the app.

Part of https://github.com/vector-im/element-web/issues/16283
This commit is contained in:
J. Ryan Stinnett 2021-01-28 17:21:36 +00:00
parent 41068c7849
commit 2996ceca52
3 changed files with 70 additions and 1 deletions

View file

@ -81,6 +81,7 @@ import ThreepidInviteStore, { IThreepidInvite, IThreepidInviteWireFormat } from
import {UIFeature} from "../../settings/UIFeature";
import { CommunityPrototypeStore } from "../../stores/CommunityPrototypeStore";
import DialPadModal from "../views/voip/DialPadModal";
import { showToast as showMobileGuideToast } from '../../toasts/MobileGuideToast';
/** constants for MatrixChat.state.view */
export enum Views {
@ -1186,6 +1187,11 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
) {
showAnalyticsToast(this.props.config.piwik?.policyUrl);
}
if (SdkConfig.get().mobileGuideToast) {
// The toast contains further logic to detect mobile platforms,
// check if it has been dismissed before, etc.
showMobileGuideToast();
}
}
private showScreenAfterLogin() {