Skip to content

Commit c9a0392

Browse files
committed
Frontend: Refactor Set() function in src/options/themes.js photoprism#3168
Signed-off-by: Michael Mayer <[email protected]>
1 parent a220370 commit c9a0392

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

frontend/src/options/themes.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -844,14 +844,18 @@ export const Set = (name, theme) => {
844844
return;
845845
}
846846

847-
const force = !!theme.force;
847+
if (!name) {
848+
name = theme.name;
849+
}
850+
851+
const force = theme?.force;
848852

849853
if (force) {
850854
// If the force flag is set, make this theme the only available option.
851855
options = [
852856
{
853857
text: theme.title ? theme.title : $gettext("Custom"),
854-
value: theme.name,
858+
value: name,
855859
disabled: false,
856860
},
857861
];
@@ -860,7 +864,7 @@ export const Set = (name, theme) => {
860864
// unless a theme with the same name already exists.
861865
options.push({
862866
text: theme.title ? theme.title : $gettext("Custom"),
863-
value: theme.name,
867+
value: name,
864868
disabled: false,
865869
});
866870
}

0 commit comments

Comments
 (0)