Skip to content

Commit

Permalink
Fix redirect offers.
Browse files Browse the repository at this point in the history
  • Loading branch information
shammowla committed Jan 18, 2024
1 parent c2e0e27 commit 2b77de1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sandbox/src/RedirectOffers.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,23 @@ 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", {
renderDecisions: true
})
.then(({ decisions = [] }) => {
console.log("personalized decisions", decisions);
history.push("/redirectedNewPage");
});
}, []);
}, [history]);

return (
<div className="personalization-container">
Expand Down

0 comments on commit 2b77de1

Please sign in to comment.