Skip to content

Commit

Permalink
fix when only one webview exist receive all the call from backend
Browse files Browse the repository at this point in the history
  • Loading branch information
yeweiasia committed Oct 26, 2022
1 parent 5d6bb43 commit daf4b98
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"codearts",
"plugin"
],
"version": "0.4.4",
"version": "0.4.5",
"license": "SEE LICENSE IN LICENSE",
"description": "core plugin api of cloudide frontend and backend",
"repository": {
Expand Down
3 changes: 1 addition & 2 deletions src/node/plugin-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,7 @@ export class Plugin {
*/
public async call(identifier: string, ...args: any[]): Promise<any> {
const viewType = identifier.indexOf('::') >= 0 ? identifier.substring(0, identifier.indexOf('::')) : '';
const viewContainer =
this._container.size === 1 ? this._container.values().next().value : this._container.get(viewType);
const viewContainer = this._container.get(viewType);
if (!viewContainer) {
this.log(LogLevel.ERROR, `target view not exist: ${viewType}`);
return Promise.reject(`target view not exist: ${viewType}`);
Expand Down

0 comments on commit daf4b98

Please sign in to comment.