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
This commit is contained in:
parent
0d683d87c0
commit
fa0ac4ced3
1 changed files with 1 additions and 6 deletions
|
|
@ -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…
Reference in a new issue