From 2b77de18e753af3892e834793c181cc6035f0d38 Mon Sep 17 00:00:00 2001 From: Shamiul Mowla Date: Wed, 17 Jan 2024 23:49:52 -0500 Subject: [PATCH] Fix redirect offers. --- sandbox/src/RedirectOffers.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sandbox/src/RedirectOffers.js b/sandbox/src/RedirectOffers.js index e3ab4d64f..92a80d360 100644 --- a/sandbox/src/RedirectOffers.js +++ b/sandbox/src/RedirectOffers.js @@ -13,10 +13,13 @@ governing permissions and limitations under the License. /* eslint-disable no-console */ import React, { useEffect } from "react"; +import { useHistory } from "react-router-dom"; import { Heading } from "@adobe/react-spectrum"; import ContentSecurityPolicy from "./components/ContentSecurityPolicy"; export default function RedirectOffers() { + const history = useHistory(); + useEffect(() => { window .alloy("sendEvent", { @@ -24,8 +27,9 @@ export default function RedirectOffers() { }) .then(({ decisions = [] }) => { console.log("personalized decisions", decisions); + history.push("/redirectedNewPage"); }); - }, []); + }, [history]); return (