Skip to content

Commit

Permalink
chore: 抹平数组 close#470
Browse files Browse the repository at this point in the history
  • Loading branch information
giscafer authored Sep 5, 2024
1 parent 0fd2d71 commit a067e30
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/explorer/stockProvider.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Event, EventEmitter, TreeDataProvider, TreeItem, TreeItemCollapsibleState } from 'vscode';
import { compact, flattenDeep, uniq } from 'lodash';
import globalState from '../globalState';
import { LeekTreeItem } from '../shared/leekTreeItem';
import { defaultFundInfo, SortType, StockCategory } from '../shared/typed';
Expand Down Expand Up @@ -36,7 +37,8 @@ export class StockProvider implements TreeDataProvider<LeekTreeItem> {
if (!element) {
// Root view
const stockCodes = LeekFundConfig.getConfig('leek-fund.stocks') || [];
return this.service.getData(stockCodes, this.order).then(() => {
const stockList = uniq(compact(flattenDeep(stockCodes)));
return this.service.getData(stockList, this.order).then(() => {
return this.getRootNodes();
});
} else {
Expand Down

0 comments on commit a067e30

Please sign in to comment.