Skip to content

Commit

Permalink
fix: remove view when change app
Browse files Browse the repository at this point in the history
  • Loading branch information
scarqin committed Apr 21, 2022
1 parent 0de4093 commit 5e067cf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/app/electron-main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ try {
} else if (arg.action === 'hook') {
returnValue = 'hook返回';
} else if (arg.action === 'openApp') {
if (arg.data.moduleID) {
if(subView.appView) subView.appView.remove();
if (arg.data.moduleID&&!arg.data.moduleID.includes('@eo-core')) {
// 如果要打开是同一app,忽略
if (subView.appView?.mainModuleID === arg.data.moduleID) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class SidebarComponent implements OnInit, OnDestroy {
isCollapsed: boolean;
destroy = false;
isElectron: boolean = false;
moduleID: string = 'api';
moduleID: string = '@eo-core-apimanger';
modules: Array<ModuleInfo|any>;
constructor(private electron: ElectronService, private sidebar: SidebarService) {
this.isElectron = this.electron.isElectron;
Expand Down Expand Up @@ -41,7 +41,8 @@ export class SidebarComponent implements OnInit, OnDestroy {

ngOnInit(): void {
if (this.isElectron) {
this.modules =[{ moduleName: 'API', moduleID: 'api', logo: 'icon-api' },...Array.from(window.eo.getSideModuleList())]
// TODO change app to blank page
this.modules =[{ moduleName: 'API', moduleID: '@eo-core-apimanger', logo: 'icon-api',route:'home/api/test' },...Array.from(window.eo.getSideModuleList())]
this.electron.ipcRenderer.on('moduleUpdate', (event, args) => {
console.log('get moduleUpdate');
this.modules = window.eo.getSideModuleList();
Expand Down

0 comments on commit 5e067cf

Please sign in to comment.