refactor(webui): simplify similar artists cleanup

- no need for a separate effect since we can use the existing one
- no need to cancel the similar artists query upon entering, since the
  unregister callback already does it
pull/644/head
Antti Kettunen 6 days ago
parent 0d683d87c0
commit fa0ac4ced3
No known key found for this signature in database
GPG Key ID: C6B2A3D250359BD7

@ -1,5 +1,5 @@
import { createFileRoute } from '@tanstack/react-router';
import { useEffect, useLayoutEffect } from 'react';
import { useLayoutEffect } from 'react';
import { useShellBridge } from '@/platform/shell/route-controllers';
@ -17,15 +17,10 @@ function ArtistDetailPage() {
useLayoutEffect(() => {
if (!bridge) return;
bridge.cancelSimilarArtistsLoad();
const normalizedSource = source.toLowerCase() === 'library' ? null : source.toLowerCase();
bridge.navigateToArtistDetail(id, '', normalizedSource, {
skipRouteChange: true,
});
}, [bridge, id, source]);
useEffect(() => {
if (!bridge) return;
return () => {
bridge.cancelSimilarArtistsLoad();

Loading…
Cancel
Save