@lvce-editor/source-control-worker 3.10.1 → 3.10.2
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.
|
@@ -2018,7 +2018,7 @@ const getNewDeltaPercent = (height, scrollBarHeight, relativeY) => {
|
|
|
2018
2018
|
};
|
|
2019
2019
|
};
|
|
2020
2020
|
|
|
2021
|
-
const
|
|
2021
|
+
const loadContentActual = async (state, savedState) => {
|
|
2022
2022
|
const {
|
|
2023
2023
|
fileIconCache,
|
|
2024
2024
|
height,
|
|
@@ -2084,7 +2084,6 @@ const loadContent = async (state, savedState) => {
|
|
|
2084
2084
|
gitRoot,
|
|
2085
2085
|
headerHeight,
|
|
2086
2086
|
iconDefinitions,
|
|
2087
|
-
initial: false,
|
|
2088
2087
|
inputBoxHeight,
|
|
2089
2088
|
inputPlaceholder,
|
|
2090
2089
|
inputValue,
|
|
@@ -2100,6 +2099,14 @@ const loadContent = async (state, savedState) => {
|
|
|
2100
2099
|
visibleItems
|
|
2101
2100
|
};
|
|
2102
2101
|
};
|
|
2102
|
+
const loadContent = (state, savedState) => {
|
|
2103
|
+
// eslint-disable-next-line unicorn/prefer-await
|
|
2104
|
+
return loadContentActual(state, savedState).catch(error => ({
|
|
2105
|
+
...state,
|
|
2106
|
+
loading: false,
|
|
2107
|
+
providerUnavailableMessage: error.message
|
|
2108
|
+
}));
|
|
2109
|
+
};
|
|
2103
2110
|
|
|
2104
2111
|
const info = (...args) => {
|
|
2105
2112
|
// @ts-ignore
|
|
@@ -3637,8 +3644,7 @@ const messageNode = {
|
|
|
3637
3644
|
};
|
|
3638
3645
|
const getSourceControlVirtualDom = (items, buttons, disabled, placeholder, inputMessage, message, loading, scrollBarHeight, scrollBarActive) => {
|
|
3639
3646
|
const content = message ? [messageNode, text(message)] : [...getSourceControlHeaderVirtualDom(placeholder, inputMessage), ...buttons.flatMap(button => getSourceControlButtonVirtualDom(button, disabled)), ...getSourceControlListVirtualDom(items, scrollBarHeight, scrollBarActive)];
|
|
3640
|
-
|
|
3641
|
-
const dom = [{
|
|
3647
|
+
return [{
|
|
3642
3648
|
ariaBusy: loading,
|
|
3643
3649
|
childCount: (message ? 1 : 2 + buttons.length) + (loading ? 1 : 0),
|
|
3644
3650
|
className: className,
|
|
@@ -3648,8 +3654,9 @@ const getSourceControlVirtualDom = (items, buttons, disabled, placeholder, input
|
|
|
3648
3654
|
onWheel: HandleWheel,
|
|
3649
3655
|
tabIndex: 0,
|
|
3650
3656
|
type: Div
|
|
3651
|
-
},
|
|
3652
|
-
|
|
3657
|
+
},
|
|
3658
|
+
// eslint-disable-next-line virtual-dom/no-conditional-spread
|
|
3659
|
+
...(loading ? getProgressVirtualDom() : []), ...content];
|
|
3653
3660
|
};
|
|
3654
3661
|
|
|
3655
3662
|
const renderItems = (oldState, newState) => {
|
|
@@ -3669,8 +3676,7 @@ const renderItems = (oldState, newState) => {
|
|
|
3669
3676
|
if (initial) {
|
|
3670
3677
|
return [SetDom2, id, []];
|
|
3671
3678
|
}
|
|
3672
|
-
const
|
|
3673
|
-
const dom = getSourceControlVirtualDom(visibleItems, sourceControlButtons, items.length === 0, inputPlaceholder, inputMessage, unavailableMessage, loading, scrollBarHeight, scrollBarActive);
|
|
3679
|
+
const dom = getSourceControlVirtualDom(visibleItems, sourceControlButtons, items.length === 0, inputPlaceholder, inputMessage, loading ? '' : providerUnavailableMessage, loading, scrollBarHeight, scrollBarActive);
|
|
3674
3680
|
return [SetDom2, id, dom];
|
|
3675
3681
|
};
|
|
3676
3682
|
|