File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change 11import * as vscode from 'vscode' ;
2- const path = require ( 'path' ) ;
2+ import path from 'path' ;
33
44import { createLogger } from '../logging' ;
55import DocumentListTreeItem , {
@@ -73,7 +73,7 @@ export default class CollectionTreeItem extends vscode.TreeItem
7373
7474 private _dataService : any ;
7575 private _type : CollectionTypes ;
76- documentCount : number | null ;
76+ documentCount : number | null = null ;
7777
7878 isExpanded : boolean ;
7979
@@ -333,14 +333,20 @@ export default class CollectionTreeItem extends vscode.TreeItem
333333 }
334334
335335 refreshDocumentCount = async ( ) : Promise < number > => {
336+ // Skip the count on views and time-series collections since it will error.
337+ if (
338+ this . _type === CollectionTypes . view ||
339+ this . _type === CollectionTypes . timeseries
340+ ) {
341+ this . documentCount = null ;
342+ return 0 ;
343+ }
344+
336345 try {
337346 // We fetch the document when we expand in order to show
338347 // the document count in the document list tree item `description`.
339348 this . documentCount = await this . getCount ( ) ;
340349 } catch ( err ) {
341- vscode . window . showInformationMessage (
342- `Unable to fetch document count: ${ err } `
343- ) ;
344350 return 0 ;
345351 }
346352
You can’t perform that action at this time.
0 commit comments