Clear entropy on completion of onboarding
This commit is contained in:
@ -1,19 +1,27 @@
|
||||
import { useIntl, FormattedMessage } from "react-intl";
|
||||
import { useDispatch } from "react-redux";
|
||||
import { useNavigate, Link } from "react-router-dom";
|
||||
import { RecommendedFollows } from "Const";
|
||||
import Logo from "Element/Logo";
|
||||
import FollowListBase from "Element/FollowListBase";
|
||||
import { useMemo } from "react";
|
||||
import { clearEntropy } from "State/Login";
|
||||
|
||||
import messages from "./messages";
|
||||
|
||||
export default function DiscoverFollows() {
|
||||
const { formatMessage } = useIntl();
|
||||
const dispatch = useDispatch();
|
||||
const navigate = useNavigate();
|
||||
const sortedReccomends = useMemo(() => {
|
||||
return RecommendedFollows.sort(() => (Math.random() >= 0.5 ? -1 : 1));
|
||||
}, []);
|
||||
|
||||
async function clearEntropyAndGo() {
|
||||
dispatch(clearEntropy());
|
||||
navigate("/");
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="main-content new-user" dir="auto">
|
||||
<Logo />
|
||||
@ -27,7 +35,7 @@ export default function DiscoverFollows() {
|
||||
<FormattedMessage {...messages.Share} values={{ link: <Link to="/">{formatMessage(messages.World)}</Link> }} />
|
||||
</p>
|
||||
<div className="next-actions continue-actions">
|
||||
<button type="button" onClick={() => navigate("/")}>
|
||||
<button type="button" onClick={() => clearEntropyAndGo()}>
|
||||
<FormattedMessage {...messages.Done} />{" "}
|
||||
</button>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user