mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-18 21:34:28 -04:00
Fixed: Translations for columns
(cherry picked from commit 6d53d2a153a98070c42d0619c15902b6bd5dfab4) Closes #2702
This commit is contained in:
@@ -41,7 +41,7 @@ class Icon extends PureComponent {
|
|||||||
return (
|
return (
|
||||||
<span
|
<span
|
||||||
className={containerClassName}
|
className={containerClassName}
|
||||||
title={title}
|
title={typeof title === 'function' ? title() : title}
|
||||||
>
|
>
|
||||||
{icon}
|
{icon}
|
||||||
</span>
|
</span>
|
||||||
@@ -58,7 +58,7 @@ Icon.propTypes = {
|
|||||||
name: PropTypes.object.isRequired,
|
name: PropTypes.object.isRequired,
|
||||||
kind: PropTypes.string.isRequired,
|
kind: PropTypes.string.isRequired,
|
||||||
size: PropTypes.number.isRequired,
|
size: PropTypes.number.isRequired,
|
||||||
title: PropTypes.string,
|
title: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
|
||||||
isSpinning: PropTypes.bool.isRequired,
|
isSpinning: PropTypes.bool.isRequired,
|
||||||
fixedWidth: PropTypes.bool.isRequired
|
fixedWidth: PropTypes.bool.isRequired
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -36,10 +36,17 @@ function mergeColumns(path, initialState, persistedState, computedState) {
|
|||||||
const column = initialColumns.find((i) => i.name === persistedColumn.name);
|
const column = initialColumns.find((i) => i.name === persistedColumn.name);
|
||||||
|
|
||||||
if (column) {
|
if (column) {
|
||||||
columns.push({
|
const newColumn = {};
|
||||||
...column,
|
|
||||||
isVisible: persistedColumn.isVisible
|
// We can't use a spread operator or Object.assign to clone the column
|
||||||
});
|
// or any accessors are lost and can break translations.
|
||||||
|
for (const prop of Object.keys(column)) {
|
||||||
|
Object.defineProperty(newColumn, prop, Object.getOwnPropertyDescriptor(column, prop));
|
||||||
|
}
|
||||||
|
|
||||||
|
newColumn.isVisible = persistedColumn.isVisible;
|
||||||
|
|
||||||
|
columns.push(newColumn);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user