diff --git a/src/pages/dashboard/Content/Tariffs/ModalMini/index.tsx b/src/pages/dashboard/Content/Tariffs/ModalMini/index.tsx index c3b3f61..ec18618 100644 --- a/src/pages/dashboard/Content/Tariffs/ModalMini/index.tsx +++ b/src/pages/dashboard/Content/Tariffs/ModalMini/index.tsx @@ -26,9 +26,6 @@ const ModalMini = ({ open, type, variant, close }: MWProps) => { const checkTariff = () => { if (fieldName.current != null && fieldTime.current != null && fieldPrice.current != null) { if (fieldName.current.value && fieldTime.current.value && fieldPrice.current.value) { - const getData = localStorage.getItem("tariffs"); - - if (getData != null) { tariffsArray = JSON.parse(getData); } const data = [0, 0, 0]; @@ -49,10 +46,7 @@ const ModalMini = ({ open, type, variant, close }: MWProps) => { tariffsArraySet(tariffsArrayNew); - localStorage.setItem("tariffs", JSON.stringify(tariffsArrayNew)); close(); - - console.log(tariffsArrayNew); } } }; diff --git a/src/pages/dashboard/Content/Tariffs/index.tsx b/src/pages/dashboard/Content/Tariffs/index.tsx index a910a3c..7a9a881 100644 --- a/src/pages/dashboard/Content/Tariffs/index.tsx +++ b/src/pages/dashboard/Content/Tariffs/index.tsx @@ -36,15 +36,11 @@ const Tariffs: React.FC = () => { handleOpenModalMini(); }; - const getData = localStorage.getItem("tariffs"); const tariffsArray = useTariffStore(state => state.tariffs); const tariffsArraySet = useTariffStore(state => state.setTariffs); const tariffsSelectedRowsData = useTariffStore(state => state.tariffsSelectedRowsData); - if (getData && !tariffsArray.length) { - const rows: Array = JSON.parse(getData); - if (rows.length) { tariffsArraySet(rows); }; - } + const [openModalPackage, setOpenModalPackage] = React.useState(false);