feature/IO-3026-Enhanced-Notifications - final revisions
Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
@@ -179,52 +179,6 @@ export function Manage({ conflict, bodyshop, alerts, setAlerts }) {
|
|||||||
}
|
}
|
||||||
}, [alerts, displayedAlertIds]);
|
}, [alerts, displayedAlertIds]);
|
||||||
|
|
||||||
// useEffect(() => {
|
|
||||||
// const fetchAlerts = async () => {
|
|
||||||
// try {
|
|
||||||
// const response = await fetch(ALERT_FILE_URL);
|
|
||||||
//
|
|
||||||
// // Check if the response is OK (status in the range 200-299)
|
|
||||||
// if (!response.ok) {
|
|
||||||
// console.error(`Network response was not ok: ${response.status} ${response.statusText}`);
|
|
||||||
// return; // Exit the function early since we can't proceed
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// const alerts = await response.json();
|
|
||||||
//
|
|
||||||
// // Check if alerts is an array
|
|
||||||
// if (!Array.isArray(alerts)) {
|
|
||||||
// console.error("Alerts data is not an array");
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// const displayedAlerts = JSON.parse(localStorage.getItem("displayedAlerts") || "[]");
|
|
||||||
// const alertsNotDisplayed = alerts.filter((alert) => !displayedAlerts.includes(alert.id));
|
|
||||||
//
|
|
||||||
// // Display notifications for alerts not yet displayed
|
|
||||||
// alertsNotDisplayed.forEach((alert) => {
|
|
||||||
// // Update localStorage immediately to prevent duplicate notifications
|
|
||||||
// displayedAlerts.push(alert.id);
|
|
||||||
// localStorage.setItem("displayedAlerts", JSON.stringify(displayedAlerts));
|
|
||||||
//
|
|
||||||
// notification.open({
|
|
||||||
// key: "notification-alerts-" + alert.id,
|
|
||||||
// message: alert.message,
|
|
||||||
// description: alert.description,
|
|
||||||
// type: alert.type || "info",
|
|
||||||
// duration: 0,
|
|
||||||
// placement: "bottomRight",
|
|
||||||
// closable: true
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
// } catch (error) {
|
|
||||||
// console.error("Error fetching alerts:", error);
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
//
|
|
||||||
// fetchAlerts();
|
|
||||||
// }, []);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const widgetId = InstanceRenderManager({
|
const widgetId = InstanceRenderManager({
|
||||||
imex: "IABVNO4scRKY11XBQkNr",
|
imex: "IABVNO4scRKY11XBQkNr",
|
||||||
|
|||||||
Reference in New Issue
Block a user