Skip to content

Commit 55cc169

Browse files
authored
fix: improve usability and ensure type safety (#97)
* fix(appearance): Remove duplicate initializeTheme call initializeTheme is already called in app.ts * fix(types): Type string is not assignable to type Method | undefined Replaced the generic string type with the Method type from @inertiajs/core for better type safety and alignment with Inertia.js. * fix(sidebar): Fix breadcrumbs rendering Ensure the sidebar only renders breadcrumbs when the `breadcrumbs` object exists and has entries. This prevents potential runtime errors if `breadcrumbs` is null or undefined.
1 parent 47f92bb commit 55cc169

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

resources/js/components/AppSidebarHeader.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ withDefaults(defineProps<{
1616
>
1717
<div class="flex items-center gap-2">
1818
<SidebarTrigger class="-ml-1" />
19-
<template v-if="breadcrumbs.length > 0">
19+
<template v-if="breadcrumbs && breadcrumbs.length > 0">
2020
<Breadcrumbs :breadcrumbs="breadcrumbs" />
2121
</template>
2222
</div>

resources/js/components/TextLink.vue

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<script setup lang="ts">
2+
import { Method } from '@inertiajs/core';
23
import { Link } from '@inertiajs/vue3';
34
45
interface Props {
56
href: string;
67
tabindex?: number;
7-
method?: string;
8+
method?: Method;
89
as?: string;
910
}
1011

resources/js/composables/useAppearance.ts

-2
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ export function useAppearance() {
6666
const appearance = ref<Appearance>('system');
6767

6868
onMounted(() => {
69-
initializeTheme();
70-
7169
const savedAppearance = localStorage.getItem('appearance') as Appearance | null;
7270

7371
if (savedAppearance) {

0 commit comments

Comments
 (0)