mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-01-11 22:40:31 +00:00
refactor(Settings): external player options
This commit is contained in:
parent
f0f11d15ba
commit
63d0a44fc7
1 changed files with 4 additions and 6 deletions
|
|
@ -213,14 +213,12 @@ const useProfileSettingsInputs = (profile) => {
|
|||
const playInExternalPlayerSelect = React.useMemo(() => ({
|
||||
options: externalPlayerOptions.map((opt) => ({
|
||||
value: opt.value,
|
||||
label: t(opt.label)
|
||||
label: t(opt.label),
|
||||
})),
|
||||
selected: [`${profile.settings.playerType || 'internal'}`],
|
||||
selected: [profile.settings.playerType],
|
||||
renderLabelText: () => {
|
||||
const selectedLabel = externalPlayerOptions.find(
|
||||
(opt) => opt.value === profile.settings.playerType
|
||||
)?.label;
|
||||
return t(selectedLabel);
|
||||
const selectedOption = externalPlayerOptions.find(({ value }) => value === profile.settings.playerType);
|
||||
return selectedOption ? t(selectedOption.label, { defaultValue: selectedOption.label }) : profile.settings.playerType;
|
||||
},
|
||||
onSelect: (event) => {
|
||||
core.transport.dispatch({
|
||||
|
|
|
|||
Loading…
Reference in a new issue