このコミットが含まれているのは:
dragon1211 2022-01-08 00:09:58 -08:00
コミット eaf676de40
25個のファイルの変更453行の追加94行の削除

ファイルの表示

@ -26285,14 +26285,17 @@ var AdminChildDetail = function AdminChildDetail() {
var isMountedRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(true);
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee() {
var mounted;
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
mounted = true;
isMountedRef.current = false;
setLoaded(false);
_context.next = 4;
_context.next = 5;
return axios.get("/api/admin/children/detail/".concat(params === null || params === void 0 ? void 0 : params.child_id)).then(function (response) {
if (!mounted) return;
setLoaded(true);
switch (response.data.status_code) {
@ -26309,7 +26312,12 @@ var AdminChildDetail = function AdminChildDetail() {
}
});
case 4:
case 5:
return _context.abrupt("return", function cleanup() {
mounted = false;
});
case 6:
case "end":
return _context.stop();
}
@ -26698,14 +26706,17 @@ var AdminChildEdit = function AdminChildEdit() {
var isMountedRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(true);
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee() {
var mounted;
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
mounted = true;
isMountedRef.current = false;
setLoaded(false);
_context.next = 4;
_context.next = 5;
return axios.get("/api/admin/children/detail/".concat(params === null || params === void 0 ? void 0 : params.child_id)).then(function (response) {
if (!mounted) return;
setLoaded(true);
if (response.data.status_code == 200) {
@ -26725,7 +26736,12 @@ var AdminChildEdit = function AdminChildEdit() {
}
});
case 4:
case 5:
return _context.abrupt("return", function cleanup() {
mounted = false;
});
case 6:
case "end":
return _context.stop();
}
@ -27042,14 +27058,17 @@ var AdminChilds = function AdminChilds() {
var isMountedRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(true);
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee() {
var mounted;
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
isMountedRef.current = false;
mounted = true;
setLoaded(false);
_context.next = 4;
_context.next = 5;
return axios.get('/api/admin/children/list').then(function (response) {
if (!mounted) return;
setLoaded(true);
if (response.data.status_code == 200) {
@ -27061,7 +27080,12 @@ var AdminChilds = function AdminChilds() {
}
});
case 4:
case 5:
return _context.abrupt("return", function cleanup() {
mounted = false;
});
case 6:
case "end":
return _context.stop();
}
@ -27814,14 +27838,17 @@ var AdminMeetingDetail = function AdminMeetingDetail() {
var isMountedRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(true);
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee() {
var mounted;
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
isMountedRef.current = false;
mounted = true;
setLoaded(false);
_context.next = 4;
_context.next = 5;
return axios.get("/api/admin/meetings/detail/".concat(params === null || params === void 0 ? void 0 : params.meeting_id)).then(function (response) {
if (!mounted) return;
setLoaded(true);
if (response.data.status_code == 200) {
@ -27846,7 +27873,12 @@ var AdminMeetingDetail = function AdminMeetingDetail() {
}
});
case 4:
case 5:
return _context.abrupt("return", function cleanup() {
mounted = false;
});
case 6:
case "end":
return _context.stop();
}
@ -28282,14 +28314,17 @@ var AdminMeetingEdit = function AdminMeetingEdit() {
setChildrenList(list);
}, [check_radio]);
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee() {
var mounted;
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
isMountedRef.current = false;
mounted = true;
setLoaded(false);
_context.next = 4;
_context.next = 5;
return axios.get("/api/admin/meetings/detail/".concat(meeting_id)).then(function (response) {
if (!mounted) return;
setLoaded(true);
if (response.data.status_code == 200) {
@ -28329,7 +28364,12 @@ var AdminMeetingEdit = function AdminMeetingEdit() {
}
});
case 4:
case 5:
return _context.abrupt("return", function cleanup() {
mounted = false;
});
case 6:
case "end":
return _context.stop();
}
@ -28967,6 +29007,7 @@ var AdminMeetings = function AdminMeetings() {
var isMountedRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(true);
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee() {
var mounted;
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
@ -28977,9 +29018,11 @@ var AdminMeetings = function AdminMeetings() {
}
isMountedRef.current = false;
mounted = true;
setLoaded(false);
_context.next = 5;
_context.next = 6;
return axios.get('/api/admin/meetings/list').then(function (response) {
if (!mounted) return;
setLoaded(true);
if (response.data.status_code == 200) {
@ -29010,7 +29053,12 @@ var AdminMeetings = function AdminMeetings() {
}
});
case 5:
case 6:
return _context.abrupt("return", function cleanup() {
mounted = false;
});
case 7:
case "end":
return _context.stop();
}
@ -29589,8 +29637,10 @@ var AdminParentDetail = function AdminParentDetail() {
var isMountedRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(true);
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
isMountedRef.current = false;
var mounted = true;
setLoaded(false);
axios.get("/api/admin/fathers/detail/".concat(params === null || params === void 0 ? void 0 : params.father_id)).then(function (response) {
if (!mounted) return;
setLoaded(true);
if (response.data.status_code == 200) {
@ -29600,6 +29650,9 @@ var AdminParentDetail = function AdminParentDetail() {
set400Error("失敗しました。");
}
});
return function cleanup() {
mounted = false;
};
}, []);
var handleImageChange = function handleImageChange(e) {
@ -29982,14 +30035,17 @@ var AdminParentEdit = function AdminParentEdit() {
var isMountedRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(true);
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee() {
var mounted;
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
isMountedRef.current = false;
mounted = true;
setLoaded(false);
_context.next = 4;
_context.next = 5;
return axios.get("/api/admin/fathers/detail/".concat(params === null || params === void 0 ? void 0 : params.father_id)).then(function (response) {
if (!mounted) return;
setLoaded(true);
if (response.data.status_code == 200) {
@ -30008,7 +30064,12 @@ var AdminParentEdit = function AdminParentEdit() {
}
});
case 4:
case 5:
return _context.abrupt("return", function cleanup() {
mounted = false;
});
case 6:
case "end":
return _context.stop();
}
@ -30330,14 +30391,17 @@ var AdminParents = function AdminParents() {
var isMountedRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(true);
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee() {
var mounted;
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
isMountedRef.current = false;
mounted = true;
setLoaded(false);
_context.next = 4;
_context.next = 5;
return axios.get('/api/admin/fathers/list').then(function (response) {
if (!mounted) return;
setLoaded(true);
if (response.data.status_code == 200) {
@ -30349,7 +30413,12 @@ var AdminParents = function AdminParents() {
}
});
case 4:
case 5:
return _context.abrupt("return", function cleanup() {
mounted = false;
});
case 6:
case "end":
return _context.stop();
}
@ -32405,18 +32474,21 @@ var ChildMeetingDetail = function ChildMeetingDetail() {
var isMountedRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(true);
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee() {
var mounted;
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
isMountedRef.current = false;
mounted = true;
setLoaded(false);
_context.next = 4;
_context.next = 5;
return axios.get("/api/children/meetings/detail/".concat(params.meeting_id), {
params: {
child_id: child_id
}
}).then(function (response) {
if (!mounted) return;
setLoaded(true);
setNotice(response.data.notice);
@ -32432,6 +32504,7 @@ var ChildMeetingDetail = function ChildMeetingDetail() {
set400Error("失敗しました。");
}
})["catch"](function (err) {
if (!mounted) return;
setLoaded(true);
setNotice(err.response.data.notice);
@ -32440,7 +32513,12 @@ var ChildMeetingDetail = function ChildMeetingDetail() {
}
});
case 4:
case 5:
return _context.abrupt("return", function cleanup() {
mounted = false;
});
case 6:
case "end":
return _context.stop();
}
@ -32789,18 +32867,21 @@ var ChildMeetings = function ChildMeetings() {
setLoaded(loaded1 && loaded2);
}, [loaded1, loaded2]);
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee() {
var mounted;
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
isMountedRef.current = false;
mounted = true;
setLoaded(false);
_context.next = 4;
_context.next = 5;
return axios.get('/api/children/meetings/listOfNonApprovalOfChild', {
params: {
child_id: child_id
}
}).then(function (response) {
if (!mounted) return;
setLoaded1(true);
setNotice(response.data.notice);
@ -32813,13 +32894,14 @@ var ChildMeetings = function ChildMeetings() {
}
});
case 4:
_context.next = 6;
case 5:
_context.next = 7;
return axios.get('/api/children/meetings/listOfApprovalOfChild', {
params: {
child_id: child_id
}
}).then(function (response) {
if (!mounted) return;
setLoaded2(true);
setNotice(response.data.notice);
@ -32832,7 +32914,12 @@ var ChildMeetings = function ChildMeetings() {
}
});
case 6:
case 7:
return _context.abrupt("return", function cleanup() {
mounted = false;
});
case 8:
case "end":
return _context.stop();
}
@ -33171,14 +33258,17 @@ var ChildParentDetail = function ChildParentDetail() {
var isMountedRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(true);
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee() {
var mounted;
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
isMountedRef.current = false;
mounted = true;
setLoaded(false);
_context.next = 4;
_context.next = 5;
return axios.get('/api/children/fathers/detail/' + (params === null || params === void 0 ? void 0 : params.father_id)).then(function (response) {
if (!mounted) return;
setLoaded(true);
setNotice(response.data.notice);
@ -33196,7 +33286,12 @@ var ChildParentDetail = function ChildParentDetail() {
}
});
case 4:
case 5:
return _context.abrupt("return", function cleanup() {
mounted = false;
});
case 6:
case "end":
return _context.stop();
}
@ -33398,18 +33493,21 @@ var ChildParents = function ChildParents() {
var isMountedRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(true);
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee() {
var mounted;
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
isMountedRef.current = false;
mounted = true;
setLoaded(false);
_context.next = 4;
_context.next = 5;
return axios.get('/api/children/fathers/listOfChild', {
params: {
child_id: child_id
}
}).then(function (response) {
if (!mounted) return;
setLoaded(true);
setNotice(response.data.notice);
@ -33422,7 +33520,12 @@ var ChildParents = function ChildParents() {
}
});
case 4:
case 5:
return _context.abrupt("return", function cleanup() {
mounted = false;
});
case 6:
case "end":
return _context.stop();
}
@ -33654,14 +33757,17 @@ var ChildProfileEdit = function ChildProfileEdit() {
var isMountedRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(true);
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee() {
var mounted;
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
isMountedRef.current = false;
mounted = true;
setLoaded(false);
_context.next = 4;
_context.next = 5;
return axios.get('/api/children/detail/' + child_id).then(function (response) {
if (!mounted) return;
setLoaded(true);
setNotice(response.data.notice);
@ -33686,7 +33792,12 @@ var ChildProfileEdit = function ChildProfileEdit() {
}
});
case 4:
case 5:
return _context.abrupt("return", function cleanup() {
mounted = false;
});
case 6:
case "end":
return _context.stop();
}
@ -34055,14 +34166,17 @@ var ChildProfileDetail = function ChildProfileDetail() {
var isMountedRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(true);
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee() {
var mounted;
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
isMountedRef.current = false;
mounted = true;
setLoaded(false);
_context.next = 4;
_context.next = 5;
return axios.get('/api/children/detail/' + child_id).then(function (response) {
if (!mounted) return;
setLoaded(true);
setNotice(response.data.notice);
@ -34073,6 +34187,7 @@ var ChildProfileDetail = function ChildProfileDetail() {
set400Error("失敗しました。");
}
})["catch"](function (err) {
if (!mounted) return;
setLoaded(true);
setNotice(err.response.data.notice);
@ -34081,7 +34196,12 @@ var ChildProfileDetail = function ChildProfileDetail() {
}
});
case 4:
case 5:
return _context.abrupt("return", function cleanup() {
mounted = false;
});
case 6:
case "end":
return _context.stop();
}
@ -39361,18 +39481,21 @@ var ParentChildDetail = function ParentChildDetail() {
var child_id = params === null || params === void 0 ? void 0 : params.child_id;
var isMountedRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(true);
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee() {
var mounted;
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
isMountedRef.current = false;
mounted = true;
setLoaded(false);
_context.next = 4;
_context.next = 5;
return axios.get('/api/fathers/children/detail/' + child_id, {
params: {
father_id: father_id
}
}).then(function (response) {
if (!mounted) return;
setLoaded(true);
setNotice(response.data.notice);
@ -39382,6 +39505,7 @@ var ParentChildDetail = function ParentChildDetail() {
set400Error("失敗しました。");
}
})["catch"](function (err) {
if (!mounted) return;
setLoaded(true);
setNotice(err.response.data.notice);
@ -39390,7 +39514,12 @@ var ParentChildDetail = function ParentChildDetail() {
}
});
case 4:
case 5:
return _context.abrupt("return", function cleanup() {
mounted = false;
});
case 6:
case "end":
return _context.stop();
}
@ -39680,18 +39809,21 @@ var ParentChildEdit = function ParentChildEdit() {
var child_id = params === null || params === void 0 ? void 0 : params.child_id;
var isMountedRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(true);
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee() {
var mounted;
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
isMountedRef.current = false;
mounted = true;
setLoaded(false);
_context.next = 4;
_context.next = 5;
return axios.get('/api/fathers/children/detail/' + child_id, {
params: {
father_id: father_id
}
}).then(function (response) {
if (!mounted) return;
setNotice(response.data.notice);
setLoaded(true);
@ -39705,6 +39837,7 @@ var ParentChildEdit = function ParentChildEdit() {
set400Error("失敗しました。");
}
})["catch"](function (err) {
if (!mounted) return;
setLoaded(true);
setNotice(err.response.data.notice);
@ -39713,7 +39846,12 @@ var ParentChildEdit = function ParentChildEdit() {
}
});
case 4:
case 5:
return _context.abrupt("return", function cleanup() {
mounted = false;
});
case 6:
case "end":
return _context.stop();
}
@ -39960,18 +40098,21 @@ var ParentChilds = function ParentChilds() {
var isMountedRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(true);
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee() {
var mounted;
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
isMountedRef.current = false;
mounted = true;
setLoaded(false);
_context.next = 4;
_context.next = 5;
return axios.get('/api/fathers/children/listOfFather', {
params: {
father_id: father_id
}
}).then(function (response) {
if (!mounted) return;
setLoaded(true);
setNotice(response.data.notice);
@ -39984,7 +40125,12 @@ var ParentChilds = function ParentChilds() {
}
});
case 4:
case 5:
return _context.abrupt("return", function cleanup() {
mounted = false;
});
case 6:
case "end":
return _context.stop();
}
@ -40234,18 +40380,21 @@ var ParentFavorite = function ParentFavorite() {
setLoaded(loaded1 && loaded2);
}, [loaded1, loaded2]);
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee() {
var mounted;
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
isMountedRef.current = false;
mounted = true;
setLoaded(false);
_context.next = 4;
_context.next = 5;
return axios.get('/api/fathers/meetings/listOfNonFavoriteOfFather', {
params: {
father_id: father_id
}
}).then(function (response) {
if (!mounted) return;
setLoaded1(true);
setNotice(response.data.notice);
@ -40276,13 +40425,14 @@ var ParentFavorite = function ParentFavorite() {
}
});
case 4:
_context.next = 6;
case 5:
_context.next = 7;
return axios.get('/api/fathers/meetings/listOfFavoriteOfFather', {
params: {
father_id: father_id
}
}).then(function (response) {
if (!mounted) return;
setLoaded2(true);
setNotice(response.data.notice);
@ -40313,7 +40463,12 @@ var ParentFavorite = function ParentFavorite() {
}
});
case 6:
case 7:
return _context.abrupt("return", function cleanup() {
mounted = false;
});
case 8:
case "end":
return _context.stop();
}
@ -40826,17 +40981,18 @@ var ParentMeetingAdd = function ParentMeetingAdd() {
var state = location.state;
var isMountedRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(true);
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee() {
var images, i, arr, _i2;
var mounted, images, i, arr, _i2;
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
isMountedRef.current = false;
mounted = true;
setLoaded(false);
if (!state) {
_context.next = 19;
_context.next = 20;
break;
}
@ -40864,16 +41020,17 @@ var ParentMeetingAdd = function ParentMeetingAdd() {
setChildrenList(arr);
if (state.children.length == state.approval.length && state.approval.length > 0) setCheckRadio('all_send');else if (state.children.length != state.approval.length && state.approval.length > 0) setCheckRadio('pickup_send');else setCheckRadio('');
_context.next = 21;
_context.next = 22;
break;
case 19:
_context.next = 21;
case 20:
_context.next = 22;
return axios.get('/api/fathers/children/listOfFather', {
params: {
father_id: father_id
}
}).then(function (response) {
if (!mounted) return;
setLoaded(true);
setNotice(response.data.notice);
@ -40894,7 +41051,12 @@ var ParentMeetingAdd = function ParentMeetingAdd() {
}
});
case 21:
case 22:
return _context.abrupt("return", function cleanup() {
mounted = false;
});
case 23:
case "end":
return _context.stop();
}
@ -42164,18 +42326,21 @@ var ParentMeetingEdit = function ParentMeetingEdit() {
var isMountedRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(true);
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee() {
var mounted;
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
isMountedRef.current = false;
mounted = true;
setLoaded(false);
_context.next = 4;
_context.next = 5;
return axios.get("/api/fathers/meetings/detail/".concat(meeting_id), {
params: {
father_id: father_id
}
}).then(function (response) {
if (!mounted) return;
setLoaded(true);
setNotice(response.data.notice);
@ -42213,6 +42378,7 @@ var ParentMeetingEdit = function ParentMeetingEdit() {
set400Error("失敗しました。");
}
})["catch"](function (err) {
if (!mounted) return;
setLoaded(true);
setNotice(err.response.data.notice);
@ -42221,7 +42387,12 @@ var ParentMeetingEdit = function ParentMeetingEdit() {
}
});
case 4:
case 5:
return _context.abrupt("return", function cleanup() {
mounted = false;
});
case 6:
case "end":
return _context.stop();
}
@ -42919,18 +43090,21 @@ var ParentMeetings = function ParentMeetings() {
setLoaded(loaded1 && loaded2);
}, [loaded1, loaded2]);
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee() {
var mounted;
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
isMountedRef.current = false;
mounted = true;
setLoaded(false);
_context.next = 4;
_context.next = 5;
return axios.get('/api/fathers/meetings/listOfIncompleteOfFather', {
params: {
father_id: father_id
}
}).then(function (response) {
if (!mounted) return;
setLoaded1(true);
setNotice(response.data.notice);
@ -42961,13 +43135,14 @@ var ParentMeetings = function ParentMeetings() {
return console.log(err);
});
case 4:
_context.next = 6;
case 5:
_context.next = 7;
return axios.get('/api/fathers/meetings/listOfCompleteOfFather', {
params: {
father_id: father_id
}
}).then(function (response) {
if (!mounted) return;
setLoaded2(true);
setNotice(response.data.notice);
@ -42998,7 +43173,12 @@ var ParentMeetings = function ParentMeetings() {
return console.log(err);
});
case 6:
case 7:
return _context.abrupt("return", function cleanup() {
mounted = false;
});
case 8:
case "end":
return _context.stop();
}
@ -43472,14 +43652,17 @@ var ParentProfileEdit = function ParentProfileEdit() {
var isMountedRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(true);
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee() {
var mounted;
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
isMountedRef.current = false;
mounted = true;
setLoaded(false);
_context.next = 4;
_context.next = 5;
return axios.get("/api/fathers/detail/".concat(father_id)).then(function (response) {
if (!mounted) return;
setLoaded(true);
setNotice(response.data.notice);
@ -43495,6 +43678,7 @@ var ParentProfileEdit = function ParentProfileEdit() {
set400Error("失敗しました。");
}
})["catch"](function (err) {
if (!mounted) return;
setLoaded(true);
setNotice(err.response.data.notice);
@ -43503,7 +43687,12 @@ var ParentProfileEdit = function ParentProfileEdit() {
}
});
case 4:
case 5:
return _context.abrupt("return", function cleanup() {
mounted = false;
});
case 6:
case "end":
return _context.stop();
}
@ -43832,14 +44021,17 @@ var ParentProfileDetail = function ParentProfileDetail() {
var isMountedRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(true);
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee() {
var mounted;
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
isMountedRef.current = false;
mounted = true;
setLoaded(false);
_context.next = 4;
_context.next = 5;
return axios.get('/api/fathers/detail/' + father_id).then(function (response) {
if (!mounted) return;
setLoaded(true);
setNotice(response.data.notice);
@ -43850,6 +44042,7 @@ var ParentProfileDetail = function ParentProfileDetail() {
set400Error("失敗しました。");
}
})["catch"](function (err) {
if (!mounted) return;
setLoaded(true);
setNotice(err.response.data.notice);
@ -43858,7 +44051,12 @@ var ParentProfileDetail = function ParentProfileDetail() {
}
});
case 4:
case 5:
return _context.abrupt("return", function cleanup() {
mounted = false;
});
case 6:
case "end":
return _context.stop();
}

ファイルの表示

@ -30,11 +30,13 @@ const AdminChildDetail = () => {
const isMountedRef = useRef(true);
useEffect(async () => {
let mounted = true;
isMountedRef.current = false;
setLoaded(false);
await axios.get(`/api/admin/children/detail/${params?.child_id}`)
.then(response => {
if(!mounted) return;
setLoaded(true);
switch(response.data.status_code){
case 200:{
@ -45,6 +47,10 @@ const AdminChildDetail = () => {
case 400: set400Error('失敗しました。'); break;
}
})
return function cleanup() {
mounted = false
}
},[]);

ファイルの表示

@ -36,11 +36,13 @@ const AdminChildEdit = () => {
const isMountedRef = useRef(true);
useEffect(async () => {
let mounted = true;
isMountedRef.current = false;
setLoaded(false);
await axios.get(`/api/admin/children/detail/${params?.child_id}`)
.then(response => {
if(!mounted) return;
setLoaded(true);
if(response.data.status_code==200)
{
@ -59,6 +61,10 @@ const AdminChildEdit = () => {
set400Error("失敗しました。");
}
})
return function cleanup() {
mounted = false
}
},[]);

ファイルの表示

@ -27,22 +27,28 @@ const AdminChilds = () => {
useEffect( async () => {
isMountedRef.current = false;
let mounted = true;
setLoaded(false);
await axios.get('/api/admin/children/list')
.then((response) => {
setLoaded(true);
if(response.data.status_code==200){
setChildrenList(response.data.params);
var len = response.data.params.length;
if(len > INFINITE)
setFetchChildrenList(response.data.params.slice(0, INFINITE));
else setFetchChildrenList(response.data.params.slice(0, len));
}
else {
set400Error("失敗しました。");
}
if(!mounted) return;
setLoaded(true);
if(response.data.status_code==200){
setChildrenList(response.data.params);
var len = response.data.params.length;
if(len > INFINITE)
setFetchChildrenList(response.data.params.slice(0, INFINITE));
else setFetchChildrenList(response.data.params.slice(0, len));
}
else {
set400Error("失敗しました。");
}
});
return function cleanup() {
mounted = false
}
}, []);
const fetchMoreChildrenList = () => {

ファイルの表示

@ -31,27 +31,33 @@ const AdminMeetingDetail = () => {
useEffect( async () => {
isMountedRef.current = false;
let mounted = true;
setLoaded(false);
await axios.get(`/api/admin/meetings/detail/${params?.meeting_id}`)
.then((response) => {
setLoaded(true);
if(response.data.status_code==200){
var list = response.data.params;
var total=0, num=0;
if(list.approval){
for(var i in list.approval)
{
if(list.approval[i].approval_at) num ++;
total ++;
}
if(!mounted) return;
setLoaded(true);
if(response.data.status_code==200){
var list = response.data.params;
var total=0, num=0;
if(list.approval){
for(var i in list.approval)
{
if(list.approval[i].approval_at) num ++;
total ++;
}
setMeeting({...list, denominator:total, numerator:num});
if(list.meeting_image.length > 0) setThumbnail(list.meeting_image[0].image);
}
else {
set400Error("失敗しました。");
}
}
setMeeting({...list, denominator:total, numerator:num});
if(list.meeting_image.length > 0) setThumbnail(list.meeting_image[0].image);
}
else {
set400Error("失敗しました。");
}
});
return function cleanup() {
mounted = false
}
}, []);

ファイルの表示

@ -59,9 +59,11 @@ const AdminMeetingEdit = () => {
useEffect( async () => {
isMountedRef.current = false;
let mounted = true;
setLoaded(false);
await axios.get(`/api/admin/meetings/detail/${meeting_id}`)
.then(response => {
if(!mounted) return;
setLoaded(true);
if(response.data.status_code==200){
setMeeting(response.data.params); //Success
@ -92,6 +94,10 @@ const AdminMeetingEdit = () => {
set400Error("失敗しました。");
}
});
return function cleanup() {
mounted = false
}
}, []);

ファイルの表示

@ -37,9 +37,13 @@ const AdminMeetings = () => {
}
isMountedRef.current = false;
let mounted = true;
setLoaded(false);
await axios.get('/api/admin/meetings/list')
.then(response => {
if(!mounted) return;
setLoaded(true);
if(response.data.status_code==200){
//------------Calculate Numerator & Denominator--------------
@ -64,6 +68,10 @@ const AdminMeetings = () => {
set400Error("失敗しました。");
}
});
return function cleanup() {
mounted = false
}
}, []);

ファイルの表示

@ -37,9 +37,12 @@ const AdminParentDetail = () => {
useEffect(() => {
isMountedRef.current = false;
let mounted = true;
setLoaded(false);
axios.get(`/api/admin/fathers/detail/${params?.father_id}`)
.then(response => {
if(!mounted) return;
setLoaded(true);
if(response.data.status_code==200){
setParent(response.data.params);
@ -49,6 +52,9 @@ const AdminParentDetail = () => {
set400Error("失敗しました。");
}
})
return function cleanup() {
mounted = false
}
},[]);

ファイルの表示

@ -34,10 +34,13 @@ const AdminParentEdit = () => {
useEffect( async () => {
isMountedRef.current = false;
let mounted = true;
setLoaded(false);
await axios.get(`/api/admin/fathers/detail/${params?.father_id}`)
.then(response => {
if(!mounted) return;
setLoaded(true);
if(response.data.status_code==200){
var parent = response.data.params;
@ -54,6 +57,9 @@ const AdminParentEdit = () => {
set400Error("失敗しました。");
}
})
return function cleanup() {
mounted = false
}
},[]);

ファイルの表示

@ -26,22 +26,28 @@ const AdminParents = () => {
useEffect( async () => {
isMountedRef.current = false;
let mounted = true;
setLoaded(false);
await axios.get('/api/admin/fathers/list')
.then((response) => {
setLoaded(true);
if(response.data.status_code==200){
setFatherList(response.data.params);
var len = response.data.params.length;
if(len > INFINITE)
setFetchFatherList(response.data.params.slice(0, INFINITE));
else setFetchFatherList(response.data.params.slice(0, len));
}
else {
set400Error("失敗しました。");
}
if(!mounted) return;
setLoaded(true);
if(response.data.status_code==200){
setFatherList(response.data.params);
var len = response.data.params.length;
if(len > INFINITE)
setFetchFatherList(response.data.params.slice(0, INFINITE));
else setFetchFatherList(response.data.params.slice(0, len));
}
else {
set400Error("失敗しました。");
}
});
return function cleanup() {
mounted = false
}
}, []);
const fetchMoreFatherList = () => {

ファイルの表示

@ -36,10 +36,12 @@ const ChildMeetingDetail = () => {
useEffect( async () => {
isMountedRef.current = false;
let mounted = true;
setLoaded(false);
await axios.get(`/api/children/meetings/detail/${params.meeting_id}`, {params:{child_id: child_id}})
.then(response => {
if(!mounted) return;
setLoaded(true);
setNotice(response.data.notice);
if(response.data.status_code == 200)
@ -56,12 +58,17 @@ const ChildMeetingDetail = () => {
}
})
.catch(err=>{
if(!mounted) return;
setLoaded(true);
setNotice(err.response.data.notice);
if(err.response.status==404){
set404Error(err.response.data.message);
}
})
return function cleanup() {
mounted = false
}
},[]);

ファイルの表示

@ -42,10 +42,12 @@ const ChildMeetings = () => {
useEffect( async () => {
isMountedRef.current = false;
let mounted = true;
setLoaded(false);
await axios.get('/api/children/meetings/listOfNonApprovalOfChild', {params:{child_id: child_id}})
.then(response => {
if(!mounted) return;
setLoaded1(true);
setNotice(response.data.notice);
if(response.data.status_code==200){
@ -62,6 +64,7 @@ const ChildMeetings = () => {
await axios.get('/api/children/meetings/listOfApprovalOfChild', {params:{child_id: child_id}})
.then(response => {
if(!mounted) return;
setLoaded2(true);
setNotice(response.data.notice);
if(response.data.status_code==200){
@ -75,6 +78,10 @@ const ChildMeetings = () => {
set400Error("失敗しました。");
}
})
return function cleanup() {
mounted = false
}
},[]);
const fetchMoreListNonApproval = () => {

ファイルの表示

@ -22,9 +22,12 @@ const ChildParentDetail = () => {
useEffect( async () => {
isMountedRef.current = false;
let mounted = true;
setLoaded(false);
await axios.get('/api/children/fathers/detail/'+ params?.father_id)
.then(response => {
if(!mounted) return;
setLoaded(true);
setNotice(response.data.notice);
if(response.data.status_code==200){
@ -41,6 +44,10 @@ const ChildParentDetail = () => {
set404Error(err.response.data.message);
}
})
return function cleanup() {
mounted = false
}
},[]);
useEffect(()=>{

ファイルの表示

@ -24,10 +24,12 @@ const ChildParents = () => {
useEffect( async () => {
isMountedRef.current = false;
let mounted = true;
setLoaded(false);
await axios.get('/api/children/fathers/listOfChild', {params: {child_id: child_id}})
.then(response => {
if(!mounted) return;
setLoaded(true);
setNotice(response.data.notice);
if(response.data.status_code==200){
@ -41,6 +43,10 @@ const ChildParents = () => {
set400Error("失敗しました。");
}
})
return function cleanup() {
mounted = false
}
}, []);

ファイルの表示

@ -41,10 +41,12 @@ const ChildProfileEdit = () => {
useEffect( async () => {
isMountedRef.current = false;
let mounted = true;
setLoaded(false);
await axios.get('/api/children/detail/'+child_id)
.then(response => {
if(!mounted) return;
setLoaded(true);
setNotice(response.data.notice);
if(response.data.status_code==200){
@ -67,6 +69,9 @@ const ChildProfileEdit = () => {
set404Error(err.response.data.message);
}
})
return function cleanup() {
mounted = false
}
},[]);

ファイルの表示

@ -30,9 +30,11 @@ const ChildProfileDetail = () => {
useEffect( async () => {
isMountedRef.current = false;
let mounted = true;
setLoaded(false);
await axios.get('/api/children/detail/'+ child_id)
.then(response => {
if(!mounted) return;
setLoaded(true);
setNotice(response.data.notice);
if(response.data.status_code==200){
@ -43,12 +45,17 @@ const ChildProfileDetail = () => {
}
})
.catch(err=>{
if(!mounted) return;
setLoaded(true);
setNotice(err.response.data.notice);
if(err.response.status==404){
set404Error(err.response.data.message);
}
})
return function cleanup() {
mounted = false
}
},[]);
useEffect(() => {

ファイルの表示

@ -28,9 +28,12 @@ const ParentChildDetail = () => {
useEffect( async () => {
isMountedRef.current = false;
let mounted = true;
setLoaded(false);
await axios.get('/api/fathers/children/detail/'+child_id, {params:{father_id: father_id}})
.then(response => {
if(!mounted) return;
setLoaded(true);
setNotice(response.data.notice);
if(response.data.status_code==200){
@ -41,12 +44,17 @@ const ParentChildDetail = () => {
}
})
.catch(err=>{
if(!mounted) return;
setLoaded(true);
setNotice(err.response.data.notice);
if(err.response.status==404){
set404Error(err.response.data.message);
}
})
return function cleanup() {
mounted = false
}
},[]);
//-------------------------------------------------------------

ファイルの表示

@ -32,9 +32,11 @@ const ParentChildEdit = () => {
useEffect( async () => {
isMountedRef.current = false;
let mounted = true;
setLoaded(false);
await axios.get('/api/fathers/children/detail/'+child_id, {params:{father_id: father_id}})
.then(response => {
if(!mounted) return;
setNotice(response.data.notice);
setLoaded(true);
if(response.data.status_code==200){
@ -45,12 +47,17 @@ const ParentChildEdit = () => {
}
})
.catch(err=>{
if(!mounted) return;
setLoaded(true);
setNotice(err.response.data.notice);
if(err.response.status==404){
set404Error(err.response.data.message);
}
})
return function cleanup() {
mounted = false
}
},[]);
const handleSubmit = async (e) => {

ファイルの表示

@ -26,10 +26,12 @@ const ParentChilds = () => {
useEffect( async () => {
isMountedRef.current = false;
let mounted = true;
setLoaded(false);
await axios.get('/api/fathers/children/listOfFather', {params: {father_id: father_id}})
.then(response => {
if(!mounted) return;
setLoaded(true);
setNotice(response.data.notice);
if(response.data.status_code==200){
@ -43,6 +45,10 @@ const ParentChilds = () => {
set400Error("失敗しました。");
}
})
return function cleanup() {
mounted = false
}
}, []);

ファイルの表示

@ -39,10 +39,14 @@ const ParentFavorite = () => {
useEffect(async () => {
isMountedRef.current = false;
let mounted = true;
setLoaded(false);
await axios.get('/api/fathers/meetings/listOfNonFavoriteOfFather', {params:{father_id: father_id}})
.then(response => {
if(!mounted) return;
setLoaded1(true);
setNotice(response.data.notice);
if(response.data.status_code==200){
@ -70,6 +74,9 @@ const ParentFavorite = () => {
await axios.get('/api/fathers/meetings/listOfFavoriteOfFather', {params:{father_id: father_id}})
.then(response => {
if(!mounted) return;
setLoaded2(true);
setNotice(response.data.notice);
if(response.data.status_code==200){
@ -94,6 +101,10 @@ const ParentFavorite = () => {
set400Error("失敗しました。");
}
})
return function cleanup() {
mounted = false
}
},[]);
const fetchMoreListOfNonFavorite = () => {

ファイルの表示

@ -39,6 +39,7 @@ const ParentMeetingAdd = () => {
useEffect( async () => {
isMountedRef.current = false;
let mounted = true;
setLoaded(false);
if(state){
setLoaded(true);
@ -67,6 +68,7 @@ const ParentMeetingAdd = () => {
else{
await axios.get('/api/fathers/children/listOfFather', {params:{father_id: father_id}})
.then(response=>{
if(!mounted) return;
setLoaded(true);
setNotice(response.data.notice);
if(response.data.status_code == 200){
@ -84,6 +86,10 @@ const ParentMeetingAdd = () => {
}
})
}
return function cleanup() {
mounted = false
}
},[])
//-------------------------------------------------------------

ファイルの表示

@ -47,9 +47,11 @@ const ParentMeetingEdit = () => {
useEffect(async () => {
isMountedRef.current = false;
let mounted = true;
setLoaded(false);
await axios.get(`/api/fathers/meetings/detail/${meeting_id}`, {params: { father_id: father_id}})
.then(response => {
if(!mounted) return;
setLoaded(true);
setNotice(response.data.notice);
if(response.data.status_code==200){
@ -82,12 +84,17 @@ const ParentMeetingEdit = () => {
}
})
.catch(err=>{
if(!mounted) return;
setLoaded(true);
setNotice(err.response.data.notice);
if(err.response.status==404){
set404Error(err.response.data.message);
}
})
return function cleanup() {
mounted = false
}
}, []);
//-------------------------------------------------------------

ファイルの表示

@ -50,10 +50,12 @@ const ParentMeetings = () => {
useEffect( async () => {
isMountedRef.current = false;
let mounted = true;
setLoaded(false);
await axios.get('/api/fathers/meetings/listOfIncompleteOfFather', {params:{father_id: father_id}})
.then(response => {
if(!mounted) return;
setLoaded1(true);
setNotice(response.data.notice);
if(response.data.status_code==200){
@ -79,6 +81,7 @@ const ParentMeetings = () => {
await axios.get('/api/fathers/meetings/listOfCompleteOfFather', {params:{father_id: father_id}})
.then(response => {
if(!mounted) return;
setLoaded2(true);
setNotice(response.data.notice);
if(response.data.status_code==200){
@ -101,6 +104,10 @@ const ParentMeetings = () => {
}
})
.catch(err=>console.log(err));
return function cleanup() {
mounted = false
}
},[]);
const fetchMoreListNonApproval = () => {

ファイルの表示

@ -34,9 +34,11 @@ const ParentProfileEdit = () => {
useEffect( async () => {
isMountedRef.current = false;
let mounted = true;
setLoaded(false);
await axios.get(`/api/fathers/detail/${father_id}`)
.then(response => {
if(!mounted) return;
setLoaded(true);
setNotice(response.data.notice);
if(response.data.status_code==200) {
@ -51,12 +53,17 @@ const ParentProfileEdit = () => {
}
})
.catch(err=>{
if(!mounted) return;
setLoaded(true);
setNotice(err.response.data.notice);
if(err.response.status==404){
set404Error(err.response.data.message);
}
})
return function cleanup() {
mounted = false
}
}, []);
const handleSubmit = async (e) => {

ファイルの表示

@ -30,9 +30,11 @@ const ParentProfileDetail = () => {
useEffect( async () => {
isMountedRef.current = false;
let mounted = true;
setLoaded(false);
await axios.get('/api/fathers/detail/'+father_id)
.then(response => {
if(!mounted) return;
setLoaded(true);
setNotice(response.data.notice);
if(response.data.status_code==200){
@ -44,12 +46,17 @@ const ParentProfileDetail = () => {
}
})
.catch(err=>{
if(!mounted) return;
setLoaded(true);
setNotice(err.response.data.notice);
if(err.response.status==404){
set404Error(err.response.data.message);
}
})
return function cleanup() {
mounted = false
}
},[]);
useEffect(() => {