@lvce-editor/activity-bar-worker 2.3.0 → 3.0.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.
|
@@ -1774,14 +1774,23 @@ const getActivityBarItems = () => {
|
|
|
1774
1774
|
}];
|
|
1775
1775
|
};
|
|
1776
1776
|
|
|
1777
|
+
const getActiveView = async () => {
|
|
1778
|
+
try {
|
|
1779
|
+
const activeView = await invoke('Layout.getActiveSideBarView');
|
|
1780
|
+
return activeView;
|
|
1781
|
+
} catch {
|
|
1782
|
+
return Explorer;
|
|
1783
|
+
}
|
|
1784
|
+
};
|
|
1777
1785
|
const loadContent = async (state, savedState) => {
|
|
1778
1786
|
const {
|
|
1779
1787
|
height,
|
|
1780
1788
|
itemHeight
|
|
1781
1789
|
} = state;
|
|
1782
1790
|
const items = getActivityBarItems();
|
|
1783
|
-
const
|
|
1784
|
-
const
|
|
1791
|
+
const activeView = await getActiveView();
|
|
1792
|
+
const index = items.findIndex(item => item.id === activeView);
|
|
1793
|
+
const itemsWithSelected = markSelected(items, index);
|
|
1785
1794
|
const filteredItems = getFilteredActivityBarItems(itemsWithSelected, height, itemHeight);
|
|
1786
1795
|
const newItems = await updateItemsWithBadgeCount(filteredItems);
|
|
1787
1796
|
return {
|
|
@@ -1789,7 +1798,7 @@ const loadContent = async (state, savedState) => {
|
|
|
1789
1798
|
activityBarItems: itemsWithSelected,
|
|
1790
1799
|
currentViewletId: Explorer,
|
|
1791
1800
|
filteredItems: newItems,
|
|
1792
|
-
selectedIndex:
|
|
1801
|
+
selectedIndex: index,
|
|
1793
1802
|
sideBarLocation: Left,
|
|
1794
1803
|
sideBarVisible: true
|
|
1795
1804
|
};
|