Skip to content

Commit dbff115

Browse files
committed
fix: resolve remaining component function and prop issues
1 parent 1c89df0 commit dbff115

2 files changed

Lines changed: 21 additions & 9 deletions

File tree

desktop/src/lib/BackButton.svelte

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<script lang="ts">
22
import { onMount } from 'svelte';
33
4-
export const fallbackPath: string = '/';
5-
export const showText: boolean = true;
6-
export const customClass: string = '';
4+
export let fallbackPath: string = '/';
5+
export let showText: boolean = true;
6+
export let customClass: string = '';
77
// Hide button on these paths (home by default)
8-
export const hideOnPaths: string[] = ['/'];
8+
export let hideOnPaths: string[] = ['/'];
99
1010
let _isVisible = true;
1111
@@ -27,13 +27,25 @@ function _goBack() {
2727
}
2828
}
2929
30+
// Initialize visibility immediately
31+
updateVisibility();
32+
3033
onMount(() => {
34+
// Update visibility again on mount in case window object is ready
3135
updateVisibility();
32-
window.addEventListener('popstate', updateVisibility);
33-
window.addEventListener('hashchange', updateVisibility);
36+
37+
const handleVisibilityUpdate = () => {
38+
updateVisibility();
39+
// Force Svelte to re-render by updating a reactive variable
40+
_isVisible = _isVisible; // This triggers reactivity
41+
};
42+
43+
window.addEventListener('popstate', handleVisibilityUpdate);
44+
window.addEventListener('hashchange', handleVisibilityUpdate);
45+
3446
return () => {
35-
window.removeEventListener('popstate', updateVisibility);
36-
window.removeEventListener('hashchange', updateVisibility);
47+
window.removeEventListener('popstate', handleVisibilityUpdate);
48+
window.removeEventListener('hashchange', handleVisibilityUpdate);
3749
};
3850
});
3951
</script>

desktop/src/lib/ThemeSwitcher.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ async function initializeConfig() {
135135
initializeConfig();
136136
console.log('Using Terraphim Server URL:', CONFIG.ServerURL);
137137
138-
function __updateRole(event: Event) {
138+
function _updateRole(event: Event) {
139139
const target = event.currentTarget as HTMLSelectElement;
140140
const newRoleName = target.value;
141141
console.log('Role change requested:', newRoleName);

0 commit comments

Comments
 (0)