Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dispose explorer view welcome correctly #11312

Merged
merged 2 commits into from
Jun 20, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import { WebviewView, WebviewViewResolver } from '../webview-views/webview-views
import { WebviewWidget, WebviewWidgetIdentifier } from '../webview/webview';
import { CancellationToken } from '@theia/core/lib/common/cancellation';
import { v4 } from 'uuid';
import { nls } from '@theia/core';

export const PLUGIN_VIEW_FACTORY_ID = 'plugin-view';
export const PLUGIN_VIEW_CONTAINER_FACTORY_ID = 'plugin-view-container';
Expand Down Expand Up @@ -144,12 +145,13 @@ export class PluginViewRegistry implements FrontendApplicationContribution {
});
this.widgetManager.onDidCreateWidget(event => {
if (event.widget instanceof FileNavigatorWidget) {
this.registerViewWelcome({
const disposable = new DisposableCollection();
disposable.push(this.registerViewWelcome({
view: 'explorer',
// eslint-disable-next-line max-len
content: 'You have not yet opened a folder.\n[Open Folder](command:workbench.action.files.openFolder)',
content: nls.localizeByDefault('You have not yet opened a folder.\n[Open Folder](command:{0})', 'workbench.action.files.openFolder'),
order: 0
});
}));
disposable.push(event.widget.onDidDispose(() => disposable.dispose()));
}
});
this.doRegisterViewContainer('test', 'left', {
Expand Down