defect 7 - case refresh error
This commit is contained in:
@@ -128,9 +128,11 @@ const DocumentDetails = (props) => {
|
||||
{_.has(historyObj, [
|
||||
"pinswg_publisheddate@OData.Community.Display.V1.FormattedValue",
|
||||
])
|
||||
? historyObj[
|
||||
"pinswg_publisheddate@OData.Community.Display.V1.FormattedValue"
|
||||
]
|
||||
? formatDates(
|
||||
historyObj[
|
||||
"pinswg_publisheddate@OData.Community.Display.V1.FormattedValue"
|
||||
]
|
||||
)
|
||||
: ""}
|
||||
</dd>
|
||||
<dd className="govuk-summary-list__value govuk-!-font-size-14">
|
||||
@@ -194,6 +196,15 @@ const DocumentDetails = (props) => {
|
||||
const searchDocumentResultsObj = docDetailsObj();
|
||||
}, [incidentid, setDocumentHistory, setDocumentDetails]);
|
||||
|
||||
function formatDates(dateObj) {
|
||||
var dateObj = new Date(dateObj);
|
||||
var dd = String(dateObj.getDate()).padStart(2, "0");
|
||||
var mm = String(dateObj.getMonth() + 1).padStart(2, "0"); //January is 0!
|
||||
var yyyy = dateObj.getFullYear();
|
||||
|
||||
return dd + "/" + mm + "/" + yyyy;
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className="govuk-grid-row">
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
import createWebStorage from "redux-persist/lib/storage/createWebStorage";
|
||||
|
||||
const createNoopStorage = () => {
|
||||
return {
|
||||
getItem(_key) {
|
||||
return Promise.resolve(null);
|
||||
},
|
||||
setItem(_key, value) {
|
||||
return Promise.resolve(value);
|
||||
},
|
||||
removeItem(_key) {
|
||||
return Promise.resolve();
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
const storage =
|
||||
typeof window !== "undefined"
|
||||
? createWebStorage("local")
|
||||
: createNoopStorage();
|
||||
|
||||
export default storage;
|
||||
+3
-2
@@ -4,7 +4,8 @@ import thunkMiddleware from "redux-thunk";
|
||||
import { reducer as formReducer } from "redux-form";
|
||||
import autoMergeLevel2 from "redux-persist/lib/stateReconciler/autoMergeLevel2";
|
||||
import autoMergeLevel1 from "redux-persist/lib/stateReconciler/autoMergeLevel1";
|
||||
import storage from "redux-persist/lib/storage";
|
||||
//import storage from "redux-persist/lib/storage";
|
||||
import storage from "./storage";
|
||||
import currentView from "./currentView/reducer";
|
||||
import search from "./search/reducer";
|
||||
import searchResultsObj from "./searchOutput/reducer";
|
||||
@@ -107,7 +108,7 @@ const makeStore = ({ isServer }) => {
|
||||
whitelist: [
|
||||
"currentView",
|
||||
"search",
|
||||
"searchResults",
|
||||
"searchResultsObj",
|
||||
"formData",
|
||||
"appealType",
|
||||
"LPAData",
|
||||
|
||||
Reference in New Issue
Block a user