Skip to content

Commit

Permalink
Fix passage de la valeur du thème dans le menu
Browse files Browse the repository at this point in the history
  • Loading branch information
lowzonenose committed Oct 21, 2024
1 parent 7d31859 commit 62b490c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
10 changes: 6 additions & 4 deletions src/components/modals/ModalTheme.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ import LogoSystem from "@gouvfr/dsfr/dist/artwork/pictograms/system/system.svg";
import { useEulerian } from '@/plugins/Eulerian.js';
const eulerian = useEulerian();
useScheme();
// gestion de la modale de changement de thème d'affichage
const modelValue = ref();
// recuperation du theme / scheme
const { setScheme, theme, scheme } = useScheme();
// initialisation avec le scheme (light, dark ou system)
const modelValue = ref(scheme.value);
const title = "Paramètres d'affichage";
const size = "md";
Expand Down Expand Up @@ -40,7 +43,6 @@ const themeOptions = [
}
];
const { setScheme, theme } = useScheme();
const changeTheme = () => {
setScheme(modelValue.value);
Expand Down
5 changes: 3 additions & 2 deletions src/composables/searchInArray.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
export function useSearchInArray(array, search, properties) {
return array.filter((obj) => {
if (properties.map(prop => {
if (obj.hasOwnProperty(prop) &&
obj[prop]?.toLowerCase().includes(search?.toLowerCase()))
if (obj.hasOwnProperty(prop) &&
obj[prop] &&
obj[prop].toLowerCase().includes(search?.toLowerCase()))
return true;
}).includes(true)) {
return obj;
Expand Down

0 comments on commit 62b490c

Please sign in to comment.