mirror of
https://github.com/kilyabin/psysonic.git
synced 2026-07-22 14:35:41 +00:00
fix(statistics): keep player stats tab visible without local index (#851)
* fix(statistics): keep player stats tab visible without local index Show the tab always and explain that player statistics require the local library index, with a link to library settings, instead of hiding the tab. * docs(release): CHANGELOG and credits for player stats tab UX (PR #851) * docs(credits): drop minor library index and player stats tab fixes Per team policy, small UX fixes (PR #850, #851) stay in CHANGELOG only.
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
import { useAuthStore } from '../store/authStore';
|
||||
import { useLibraryIndexStore } from '../store/libraryIndexStore';
|
||||
|
||||
/** True when local play history is recorded (master index on + ≥1 server included). */
|
||||
export function usePlayerStatsRecordingEnabled(): boolean {
|
||||
const servers = useAuthStore(s => s.servers);
|
||||
const masterEnabled = useLibraryIndexStore(s => s.masterEnabled);
|
||||
const syncExcludedByServer = useLibraryIndexStore(s => s.syncExcludedByServer);
|
||||
return masterEnabled && servers.some(s => syncExcludedByServer[s.id] !== true);
|
||||
}
|
||||
Reference in New Issue
Block a user