优化:避免重复的图标

pull/1788/head
ChenX 3 years ago
parent 0d9ebf01ba
commit 712807e1ae

@ -49,6 +49,7 @@ export class ToolbarContainer extends React.Component<{}, {}> {
{ {
end(app.WebSocket, app.WebSocket.OnLinkEvent, () => end(app.WebSocket, app.WebSocket.OnLinkEvent, () =>
{ {
arrayRemoveIf(this.iconList, l => l.command === CommandNames.ToggleSyncData);
if (app.WebSocket.IsLink) if (app.WebSocket.IsLink)
{ {
Log("成功连接到渲染器!"); Log("成功连接到渲染器!");
@ -65,8 +66,6 @@ export class ToolbarContainer extends React.Component<{}, {}> {
else else
this.iconList.push({ svg: IconEnum.Synchronous, title: "未同步", command: CommandNames.ToggleSyncData }); this.iconList.push({ svg: IconEnum.Synchronous, title: "未同步", command: CommandNames.ToggleSyncData });
} }
else
arrayRemoveIf(this.iconList, l => l.command === CommandNames.ToggleSyncData);
}); });
let gws = SwitchServerStore.GetInstance()._gangplankWs; let gws = SwitchServerStore.GetInstance()._gangplankWs;

Loading…
Cancel
Save