Skip to content

Commit

Permalink
fix: switching orgs causes developer logs panel to misbehave
Browse files Browse the repository at this point in the history
  • Loading branch information
Codeneos committed Aug 6, 2024
1 parent cc5ade8 commit 9ea7261
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/vlocity/src/vlocityNamespaceService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { mapGetOrCreate, Timer } from '@vlocode/util';
import chalk from 'chalk';
import * as constants from './constants';

@injectable({ provides: [NamespaceService, VlocityNamespaceService] })
@injectable.singleton({ provides: [NamespaceService, VlocityNamespaceService] })
export class VlocityNamespaceService extends NamespaceService {

@injectable.property private readonly logger: Logger
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { DebugLogViewer } from '../lib/salesforce/debugLogViewer';
/**
* Provides a list of recently executed or executing activities
*/
@injectable()
@injectable.singleton()
export default class DeveloperLogDataProvider extends BaseDataProvider<DeveloperLog> implements vscode.Disposable {

private logs: Array<DeveloperLog> = [];
Expand All @@ -35,6 +35,7 @@ export default class DeveloperLogDataProvider extends BaseDataProvider<Developer
ConfigurationManager.onConfigChange(this.vlocode.config, ['sfdxUsername'], config => {
this.lastRefresh = undefined;
this.logs.splice(0);
this.refresh();
if (config.sfdxUsername) {
void this.refreshLogs({ refreshView: true });
}
Expand Down Expand Up @@ -171,7 +172,7 @@ export default class DeveloperLogDataProvider extends BaseDataProvider<Developer
* @param options.refreshView Whether or not to refresh the view after the logs have been refreshed
* @throws {CustomError} When the refresh fails
*/
public async refreshLogs(options?: { refreshView?: boolean }) {
public async refreshLogs(options?: { refreshView?: boolean, }) {
await this.vlocode.validateAll(true);

// Load logs since last refresh
Expand Down

0 comments on commit 9ea7261

Please sign in to comment.