Skip to content

Commit

Permalink
fix: replace sometimes unsupported by widely supported
Browse files Browse the repository at this point in the history
  • Loading branch information
Truiteseche committed Apr 3, 2024
1 parent 3394c38 commit 340314b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ export default function App() {
const gradesFromJson = grades[activeAccount].notes;
const subjectDatas = {};

const lastGrades = gradesFromJson.toSorted((elA, elB) => (new Date(elA.dateSaisie)).getTime() - (new Date(elB.dateSaisie)).getTime()).slice(-3);
const lastGrades = [...gradesFromJson].sort((elA, elB) => (new Date(elA.dateSaisie)).getTime() - (new Date(elB.dateSaisie)).getTime()).slice(-3);

for (let grade of (gradesFromJson ?? [])) {
// handle mock exam periods
Expand Down
3 changes: 2 additions & 1 deletion src/components/generic/Window.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ export function WindowsContainer({ children, name = "", className = "", id = "",


function sortByCSSOrder(elements) {
return elements.toSorted((elA, elB) => parseInt(elA?.style.order) - parseInt(elB?.style.order));
const elementsCopy = [...elements];
return elementsCopy.sort((elA, elB) => parseInt(elA?.style.order) - parseInt(elB?.style.order));
}


Expand Down

0 comments on commit 340314b

Please sign in to comment.