mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-21 15:52:02 +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(() => ({
|
const playInExternalPlayerSelect = React.useMemo(() => ({
|
||||||
options: externalPlayerOptions.map((opt) => ({
|
options: externalPlayerOptions.map((opt) => ({
|
||||||
value: opt.value,
|
value: opt.value,
|
||||||
label: t(opt.label)
|
label: t(opt.label),
|
||||||
})),
|
})),
|
||||||
selected: [`${profile.settings.playerType || 'internal'}`],
|
selected: [profile.settings.playerType],
|
||||||
renderLabelText: () => {
|
renderLabelText: () => {
|
||||||
const selectedLabel = externalPlayerOptions.find(
|
const selectedOption = externalPlayerOptions.find(({ value }) => value === profile.settings.playerType);
|
||||||
(opt) => opt.value === profile.settings.playerType
|
return selectedOption ? t(selectedOption.label, { defaultValue: selectedOption.label }) : profile.settings.playerType;
|
||||||
)?.label;
|
|
||||||
return t(selectedLabel);
|
|
||||||
},
|
},
|
||||||
onSelect: (event) => {
|
onSelect: (event) => {
|
||||||
core.transport.dispatch({
|
core.transport.dispatch({
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue