@lvce-editor/explorer-view 2.10.0 → 2.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2701,12 +2701,29 @@ const mergeDirents$2 = (oldDirents, newDirents) => {
|
|
|
2701
2701
|
};
|
|
2702
2702
|
|
|
2703
2703
|
// TODO add lots of tests for this
|
|
2704
|
-
const refresh = async
|
|
2705
|
-
const
|
|
2706
|
-
|
|
2704
|
+
const refresh = async state => {
|
|
2705
|
+
const {
|
|
2706
|
+
root,
|
|
2707
|
+
pathSeparator,
|
|
2708
|
+
minLineY,
|
|
2709
|
+
height,
|
|
2710
|
+
itemHeight,
|
|
2711
|
+
fileIconCache
|
|
2712
|
+
} = state;
|
|
2713
|
+
const topLevelDirents = await getTopLevelDirents(root, pathSeparator, []);
|
|
2714
|
+
const newDirents = mergeDirents$2(state.items, topLevelDirents);
|
|
2715
|
+
const maxLineY = getExplorerMaxLineY(minLineY, height, itemHeight, newDirents.length);
|
|
2716
|
+
const visible = newDirents.slice(minLineY, maxLineY);
|
|
2717
|
+
const {
|
|
2718
|
+
icons,
|
|
2719
|
+
newFileIconCache
|
|
2720
|
+
} = await getFileIcons(visible, fileIconCache);
|
|
2707
2721
|
const state3 = {
|
|
2708
|
-
...
|
|
2709
|
-
items: newDirents
|
|
2722
|
+
...state,
|
|
2723
|
+
items: newDirents,
|
|
2724
|
+
fileIconCache: newFileIconCache,
|
|
2725
|
+
icons,
|
|
2726
|
+
maxLineY
|
|
2710
2727
|
};
|
|
2711
2728
|
return state3;
|
|
2712
2729
|
};
|