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 1
1
import * as vscode from 'vscode' ;
2
- const path = require ( 'path' ) ;
2
+ import path from 'path' ;
3
3
4
4
import { createLogger } from '../logging' ;
5
5
import DocumentListTreeItem , {
@@ -73,7 +73,7 @@ export default class CollectionTreeItem extends vscode.TreeItem
73
73
74
74
private _dataService : any ;
75
75
private _type : CollectionTypes ;
76
- documentCount : number | null ;
76
+ documentCount : number | null = null ;
77
77
78
78
isExpanded : boolean ;
79
79
@@ -333,14 +333,20 @@ export default class CollectionTreeItem extends vscode.TreeItem
333
333
}
334
334
335
335
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
+
336
345
try {
337
346
// We fetch the document when we expand in order to show
338
347
// the document count in the document list tree item `description`.
339
348
this . documentCount = await this . getCount ( ) ;
340
349
} catch ( err ) {
341
- vscode . window . showInformationMessage (
342
- `Unable to fetch document count: ${ err } `
343
- ) ;
344
350
return 0 ;
345
351
}
346
352
You can’t perform that action at this time.
0 commit comments