Change to record to avoid duplicate additional links during development
This commit is contained in:
parent
57b0bce367
commit
0cd462333e
@ -205,7 +205,7 @@ export class Sidebar extends React.Component {
|
||||
.toList()
|
||||
.filter(collection => collection.get('hide') !== true)
|
||||
.map(collection => this.renderLink(collection, filterTerm))}
|
||||
{additionalLinks.map(this.renderAdditionalLink)}
|
||||
{Object.values(additionalLinks).map(this.renderAdditionalLink)}
|
||||
</SidebarNavList>
|
||||
</SidebarContainer>
|
||||
);
|
||||
|
@ -26,7 +26,7 @@ const registry = {
|
||||
previewStyles: [],
|
||||
widgets: {},
|
||||
icons: {},
|
||||
additionalLinks: [],
|
||||
additionalLinks: {},
|
||||
editorComponents: Map(),
|
||||
remarkPlugins: [],
|
||||
widgetValueSerializers: {},
|
||||
@ -304,8 +304,8 @@ export function getIcon(name) {
|
||||
/**
|
||||
* Icons
|
||||
*/
|
||||
export function registerAdditionalLink(title, url, iconName) {
|
||||
registry.additionalLinks.push({ title, url, iconName });
|
||||
export function registerAdditionalLink(id, title, url, iconName) {
|
||||
registry.additionalLinks[id] = { title, url, iconName };
|
||||
}
|
||||
export function getAdditionalLinks() {
|
||||
return registry.additionalLinks;
|
||||
|
Loading…
x
Reference in New Issue
Block a user