Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ZackAustin committed Sep 5, 2024
1 parent 6c9805a commit 01d53b6
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/webview/sideBar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ export class ConnectionsViewProvider implements vscode.WebviewViewProvider {

private static _extContext: ExtensionContext;
private _view?: vscode.WebviewView;
private static currentPanel?: ConnectionPanel | undefined;
private static connectionPanel?: ConnectionPanel | undefined;
private static deleteConfirmationPanel?: DeletePanel | undefined;

constructor(private readonly _extensionUri: vscode.Uri) {}

public getPanel() {
return ConnectionsViewProvider.currentPanel;
public getConnectionPanel() {
return ConnectionsViewProvider.connectionPanel;
}

public setPanel(panel: ConnectionPanel | undefined) {
ConnectionsViewProvider.currentPanel = panel;
public setConnectionPanel(panel: ConnectionPanel | undefined) {
ConnectionsViewProvider.connectionPanel = panel;
}

public getDeleteConfirmationPanel() {
Expand Down Expand Up @@ -73,7 +73,7 @@ export class ConnectionsViewProvider implements vscode.WebviewViewProvider {
case Messages.CONNECTION_ADD_PANEL: {
let mode: PanelMode = 'Add';
ConnectionPanel.createOrShow(this._extensionUri, this, mode);
this.setPanel(ConnectionPanel.getPanel());
this.setConnectionPanel(ConnectionPanel.getPanel());
break;
}
case Messages.CONNECTION_DELETE_PANEL: {
Expand All @@ -99,7 +99,7 @@ export class ConnectionsViewProvider implements vscode.WebviewViewProvider {
case Messages.CONNECTION_EDIT_PANEL: {
let mode: PanelMode = 'Edit';
ConnectionPanel.createOrShow(this._extensionUri, this, mode, data.data);
this.setPanel(ConnectionPanel.getPanel());
this.setConnectionPanel(ConnectionPanel.getPanel());
break;
}
case Messages.CONNECTION_REFRESH: {
Expand All @@ -125,9 +125,9 @@ export class ConnectionsViewProvider implements vscode.WebviewViewProvider {

if (
ConnectionPanel.getViewType() === 'Edit' &&
this.getPanel()?.getOldConnectionName() === connectionName
this.getConnectionPanel()?.getOldConnectionName() === connectionName
) {
this.getPanel()?.dispose();
this.getConnectionPanel()?.dispose();
}

this.refreshConnections();
Expand All @@ -136,15 +136,15 @@ export class ConnectionsViewProvider implements vscode.WebviewViewProvider {
public AddConnectionPanel() {
let mode: PanelMode = 'Add';
ConnectionPanel.createOrShow(this._extensionUri, this, mode);
this.setPanel(ConnectionPanel.getPanel());
this.setConnectionPanel(ConnectionPanel.getPanel());
}

public EditConnectionPanel() {
vscode.window.showInputBox().then(input => {
if (input !== undefined) {
let mode: PanelMode = 'Edit';
ConnectionPanel.createOrShow(this._extensionUri, this, mode, input);
this.setPanel(ConnectionPanel.getPanel());
this.setConnectionPanel(ConnectionPanel.getPanel());
}
});
}
Expand Down Expand Up @@ -173,7 +173,7 @@ export class ConnectionsViewProvider implements vscode.WebviewViewProvider {
Storage.STORAGE_CONNECTIONS,
ConnectionManager.getManager().getAllConnections(),
);
this.getPanel()?.dispose();
this.getConnectionPanel()?.dispose();
this.refreshConnections();
}
}
Expand Down

0 comments on commit 01d53b6

Please sign in to comment.