diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-10-22 11:24:43 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-10-22 11:24:43 +0700 |
| commit | d6ede238658d90315a5dc5b864f20037e8a776f6 (patch) | |
| tree | 4854a5f81d74a16fc631de409249f3e056d324ef /src/lib/pengajuan-tempo/component/Referensi.jsx | |
| parent | 3a0f3c6ed7ef886d3205d51937b1ecbb035b1a87 (diff) | |
<iman> update & add section dokumen
Diffstat (limited to 'src/lib/pengajuan-tempo/component/Referensi.jsx')
| -rw-r--r-- | src/lib/pengajuan-tempo/component/Referensi.jsx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/lib/pengajuan-tempo/component/Referensi.jsx b/src/lib/pengajuan-tempo/component/Referensi.jsx index e2a341e6..dd8b66ad 100644 --- a/src/lib/pengajuan-tempo/component/Referensi.jsx +++ b/src/lib/pengajuan-tempo/component/Referensi.jsx @@ -152,9 +152,18 @@ const Referensi = ({ chekValid, buttonSubmitClick }) => { useEffect(() => { updateFormSupplier(supplierData); }, [buttonSubmit]); + const getFromLocalStorage = (key) => { + const itemStr = localStorage.getItem(key); + if (!itemStr) return null; + + const item = JSON.parse(itemStr); + return item; + }; useEffect(() => { - if (formSupplier) { - setSupplierData(formSupplier); + const cachedData = getFromLocalStorage('Referensi'); + if (cachedData) { + setSupplierData(cachedData); + updateFormSupplier(cachedData); } }, [buttonSubmitClick]); return ( |
