chore: upgrade @edx/frontend-platform to v3.4.1 (#1071)

* chore: upgrade @edx/frontend-platform to v3.4.0
* chore: upgrade to frontend-platform v3.4.1
This commit is contained in:
Adam Stankiewicz
2023-02-28 09:18:28 -05:00
committed by GitHub
parent 5166bfe056
commit 97a1cb4ffc
3 changed files with 393 additions and 247 deletions

View File

@@ -10,16 +10,19 @@ import { getNotices } from './api';
*/
const NoticesProvider = ({ children }) => {
const [isRedirected, setIsRedirected] = useState();
// eslint-disable-next-line react-hooks/exhaustive-deps
useEffect(async () => {
if (getConfig().ENABLE_NOTICES) {
const data = await getNotices();
if (data && data.results && data.results.length > 0) {
const { results } = data;
setIsRedirected(true);
window.location.replace(`${results[0]}?next=${window.location.href}`);
useEffect(() => {
async function getData() {
if (getConfig().ENABLE_NOTICES) {
const data = await getNotices();
if (data && data.results && data.results.length > 0) {
const { results } = data;
setIsRedirected(true);
window.location.replace(`${results[0]}?next=${window.location.href}`);
}
}
}
getData();
}, []);
return (