fix(ui): remove flicker-causing effect and add view transition to Settings
- Remove problematic $effect that ran loadPlaybackPreferences() on every render, causing a state update loop and visual flicker - The function is already called in onMount, so the duplicate was redundant - Add ViewTransition wrapper for consistent subtle animation (200ms fade+slide)
This commit is contained in:
1 parent
65ffabbf1d
commit
8db47aaee0
1 file changed
+4
-9
@@ -1,6 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import { invoke } from '@tauri-apps/api/core';
|
import { invoke } from '@tauri-apps/api/core';
|
||||||
|
import ViewTransition from '../ViewTransition.svelte';
|
||||||
import { getCurrentWebview } from '@tauri-apps/api/webview';
|
import { getCurrentWebview } from '@tauri-apps/api/webview';
|
||||||
import { writeText as copyToClipboard } from '@tauri-apps/plugin-clipboard-manager';
|
import { writeText as copyToClipboard } from '@tauri-apps/plugin-clipboard-manager';
|
||||||
import { ArrowLeft, ChevronRight, Loader2 } from 'lucide-svelte';
|
import { ArrowLeft, ChevronRight, Loader2 } from 'lucide-svelte';
|
||||||
@@ -679,15 +680,7 @@
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
// Reload playback preferences each time the view becomes visible
|
|
||||||
// This ensures settings are fresh when navigating back to settings
|
|
||||||
$effect(() => {
|
|
||||||
// This effect runs whenever the component is rendered
|
|
||||||
// We reload preferences to ensure they're in sync with backend
|
|
||||||
console.log('[Settings] Component rendered, reloading playback preferences');
|
|
||||||
loadPlaybackPreferences();
|
|
||||||
});
|
|
||||||
|
|
||||||
async function loadLastfmState() {
|
async function loadLastfmState() {
|
||||||
try {
|
try {
|
||||||
// Check if embedded (build-time) credentials are available
|
// Check if embedded (build-time) credentials are available
|
||||||
@@ -1789,6 +1782,7 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<ViewTransition duration={200} distance={12} direction="up">
|
||||||
<div class="settings-view" bind:this={settingsViewEl}>
|
<div class="settings-view" bind:this={settingsViewEl}>
|
||||||
<!-- Loading Overlay for Device Enumeration -->
|
<!-- Loading Overlay for Device Enumeration -->
|
||||||
{#if isLoadingDevices}
|
{#if isLoadingDevices}
|
||||||
@@ -2659,6 +2653,7 @@ flatpak override --user --filesystem=/home/USUARIO/Música com.blitzfc.qbz</pre>
|
|||||||
</section>
|
</section>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
</ViewTransition>
|
||||||
|
|
||||||
{#if isCheckingNetwork}
|
{#if isCheckingNetwork}
|
||||||
<div class="network-check-overlay" aria-busy="true" aria-label={$t('offline.checkingNetwork')}>
|
<div class="network-check-overlay" aria-busy="true" aria-label={$t('offline.checkingNetwork')}>
|
||||||
|
|||||||
Reference in new issue
Block a user