Merge pull request #4669 from matrix-org/t3chguy/toasts6_1
Allow deferring of Update Toast until the next morning
This commit is contained in:
commit
6472ca451e
5 changed files with 68 additions and 5 deletions
|
@ -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}) => {
|
||||
|
|
|
@ -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 }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue