1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-06 09:19:22 +02:00

Plugins: Fixed issue with toolbar button key not being unique

This commit is contained in:
Laurent Cozic
2020-11-20 16:19:57 +00:00
parent e0c2b62a6c
commit ee912b24c7
2 changed files with 3 additions and 2 deletions

View File

@@ -41,14 +41,14 @@ export default function styles(props: Props) {
leftIcon: { leftIcon: {
fontSize: iconSize, fontSize: iconSize,
position: 'relative', position: 'relative',
top: 2, top: 1,
color: theme.color3, color: theme.color3,
}, },
rightIcon: { rightIcon: {
fontSize: iconSize - 1, fontSize: iconSize - 1,
borderLeft: 'none', borderLeft: 'none',
position: 'relative', position: 'relative',
top: 2, top: 1,
color: theme.color3, color: theme.color3,
}, },
}; };

View File

@@ -40,6 +40,7 @@ class ToolbarBaseComponent extends React.Component<Props, any> {
const o = this.props.items[i]; const o = this.props.items[i];
let key = o.iconName ? o.iconName : ''; let key = o.iconName ? o.iconName : '';
key += o.title ? o.title : ''; key += o.title ? o.title : '';
key += o.name ? o.name : '';
const itemType = !('type' in o) ? 'button' : o.type; const itemType = !('type' in o) ? 'button' : o.type;
if (!key) key = `${o.type}_${i}`; if (!key) key = `${o.type}_${i}`;