|
|
|
@ -4,7 +4,7 @@
|
|
|
|
|
|
|
|
|
|
import { SettingsContextMenu } from '@vizality/components/vizality';
|
|
|
|
|
import { getModule, contextMenu } from '@vizality/webpack';
|
|
|
|
|
import { forceUpdateElement } from '@vizality/util/react';
|
|
|
|
|
import { forceUpdateElement, findInReactTree } from '@vizality/util/react';
|
|
|
|
|
import { patch, unpatch } from '@vizality/patcher';
|
|
|
|
|
import { Builtin } from '@vizality/entities';
|
|
|
|
|
import { Icon } from '@vizality/components';
|
|
|
|
@ -100,21 +100,19 @@ export default class Dashboard extends Builtin {
|
|
|
|
|
const { LinkButton } = getModule('LinkButton');
|
|
|
|
|
patch('vz-dashboard-private-channels-list-item', ConnectedPrivateChannelsList, 'default', (_, res) => {
|
|
|
|
|
try {
|
|
|
|
|
if (!res.props?.children?.props?.children) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
const { children: list } = findInReactTree(res, (c) => c.channels);
|
|
|
|
|
|
|
|
|
|
res.props.children.props.children = [
|
|
|
|
|
...res.props.children.props.children.slice(0, 0),
|
|
|
|
|
if (!list) return;
|
|
|
|
|
|
|
|
|
|
list.unshift(
|
|
|
|
|
<LinkButton
|
|
|
|
|
icon={() => <Icon name='vizality' />}
|
|
|
|
|
route='/vizality'
|
|
|
|
|
text='Dashboard'
|
|
|
|
|
selected={vizality.api.routes.getLocation()?.pathname?.startsWith('/vizality')}
|
|
|
|
|
onContextMenu={evt => openContextMenu(evt, () => <SettingsContextMenu />)}
|
|
|
|
|
/>,
|
|
|
|
|
...res.props.children.props.children.slice(0)
|
|
|
|
|
];
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
} catch (err) {
|
|
|
|
|
return this.error(this._labels.concat('_injectPrivateTab'), err);
|
|
|
|
|
}
|
|
|
|
|