Skip to content

Commit

Permalink
Merge pull request #404 from noharm-ai/develop
Browse files Browse the repository at this point in the history
fix compatibility issue
  • Loading branch information
marceloarocha authored Feb 19, 2025
2 parents 7aa5a23 + 2866f33 commit c4b535d
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/components/MemoryText/components/ConfigModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ export default function ConfigModal({ save, open, setOpen, list }) {
list[0].value.map((i) => {
return {
...i,
active: Object.hasOwn(i, "active") ? i.active : true,
active: Object.prototype.hasOwnProperty.call(i, "active")
? i.active
: true,
};
})
);
Expand Down
12 changes: 9 additions & 3 deletions src/components/MemoryText/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,16 @@ export default function MemoryText({
default:
loadText(
list[0].value.filter(
(item) => item.active || !Object.hasOwn(item, "active")
(item) =>
item.active ||
!Object.prototype.hasOwnProperty.call(item, "active")
)[key]?.data
);
}
};

const filterActive = (item) => item.active || !Object.hasOwn(item, "active");
const filterActive = (item) =>
item.active || !Object.prototype.hasOwnProperty.call(item, "active");

const textMenu = () => {
const filters = list && list[0]?.value ? list[0].value : [];
Expand All @@ -143,7 +146,10 @@ export default function MemoryText({
}

return list[0].value
.filter((item) => item.active || !Object.hasOwn(item, "active"))
.filter(
(item) =>
item.active || !Object.prototype.hasOwnProperty.call(item, "active")
)
.map((item, index) => {
return {
key: index,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ export default function FilterMemory({
fetchMemory(FILTER_PUBLIC_STORE_ID, FILTER_PUBLIC_MEMORY_TYPE);
}, [account.userId, fetchMemory]);

const filterActive = (item) => item.active || !Object.hasOwn(item, "active");
const filterActive = (item) =>
item.active || !Object.prototype.hasOwnProperty.call(item, "active");

const saveFilterAction = (filterName, filterType) => {
if (filterType === "public") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export default function DrugAlerts({ alerts, idSubstance }) {
alerts.forEach((a) => {
const type = a.level;

if (!Object.hasOwn(groups, type)) {
if (!Object.prototype.hasOwnProperty.call(groups, type)) {
groups[type] = [a];
} else {
groups[type].push(a);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,10 @@ const regulationPrioritizationSlice = createSlice({
const list = action.payload.response.data.data.list.map((p) => ({
...p,
patientName: patients[p.idPatient]?.name,
patientNameLoading: !Object.hasOwn(patients, p.idPatient),
patientNameLoading: !Object.prototype.hasOwnProperty.call(
patients,
p.idPatient
),
}));

state.list = list;
Expand Down

0 comments on commit c4b535d

Please sign in to comment.