Merge pull request #4669 from matrix-org/t3chguy/toasts6_1

Allow deferring of Update Toast until the next morning
This commit is contained in:
Michael Telatynski 2020-05-30 12:54:42 +01:00 committed by GitHub
commit 6472ca451e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 68 additions and 5 deletions

View file

@ -18,7 +18,6 @@ import React, {useState} from "react";
import {UpdateCheckStatus} from "../../../BasePlatform";
import PlatformPeg from "../../../PlatformPeg";
import {hideToast as hideUpdateToast} from "../../../toasts/UpdateToast";
import {useDispatcher} from "../../../hooks/useDispatcher";
import dis from "../../../dispatcher/dispatcher";
import {Action} from "../../../dispatcher/actions";
@ -60,7 +59,6 @@ const UpdateCheckButton = () => {
const onCheckForUpdateClick = () => {
setState(null);
PlatformPeg.get().startUpdateCheck();
hideUpdateToast();
};
useDispatcher(dis, ({action, ...params}) => {

View file

@ -17,17 +17,21 @@ limitations under the License.
import React, {ReactChild} from "react";
import FormButton from "../elements/FormButton";
import {XOR} from "../../../@types/common";
interface IProps {
description: ReactChild;
acceptLabel: string;
rejectLabel?: string;
onAccept();
onReject?();
}
const GenericToast: React.FC<IProps> = ({description, acceptLabel, rejectLabel, onAccept, onReject}) => {
interface IPropsExtended extends IProps {
rejectLabel: string;
onReject();
}
const GenericToast: React.FC<XOR<IPropsExtended, IProps>> = ({description, acceptLabel, rejectLabel, onAccept, onReject}) => {
return <div>
<div className="mx_Toast_description">
{ description }