mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-06-13 01:10:22 +01:00
fix(review): address second CodeRabbit pass
- streamystats: derive toggle enablement from the same effective URL the input renders (locked admin URL no longer disables every switch) - FilterSheet: use the deep-equality rule for toggling that rendering already uses — option objects are recreated across renders - DownloadCard: take t from useTranslation so badge labels re-render on language change - fileOperations: count trickplay bytes in the storage total, matching the per-item size model - PendingAccountSaveModal: warn instead of silently swallowing a failed account save
This commit is contained in:
@@ -58,7 +58,12 @@ export default function StreamystatsPage() {
|
||||
pluginSettings?.streamyStatsPromotedWatchlists?.locked === true;
|
||||
const hideWatchlistsTabLocked =
|
||||
pluginSettings?.hideWatchlistsTab?.locked === true;
|
||||
const isStreamystatsEnabled = !!url;
|
||||
// The input renders the locked admin URL; enablement must follow the same
|
||||
// effective value or every toggle stays disabled until local state syncs.
|
||||
const effectiveUrl = isUrlLocked
|
||||
? (settings?.streamyStatsServerUrl ?? "")
|
||||
: url;
|
||||
const isStreamystatsEnabled = !!effectiveUrl;
|
||||
|
||||
const onSave = useCallback(() => {
|
||||
const cleanUrl = url.endsWith("/") ? url.slice(0, -1) : url;
|
||||
@@ -155,9 +160,7 @@ export default function StreamystatsPage() {
|
||||
placeholder={t(
|
||||
"home.settings.plugins.streamystats.server_url_placeholder",
|
||||
)}
|
||||
value={
|
||||
isUrlLocked ? (settings?.streamyStatsServerUrl ?? "") : url
|
||||
}
|
||||
value={effectiveUrl}
|
||||
keyboardType='url'
|
||||
returnKeyType='done'
|
||||
autoCapitalize='none'
|
||||
|
||||
Reference in New Issue
Block a user