@lvce-editor/ports-view 0.14.0 → 0.16.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.
|
@@ -1630,7 +1630,7 @@ const recalculateVirtualList = state => {
|
|
|
1630
1630
|
const minLineY = itemHeight === 0 ? 0 : Math.floor(deltaY / itemHeight);
|
|
1631
1631
|
const visibleCount = itemHeight === 0 ? 0 : Math.ceil(listHeight / itemHeight) + 1;
|
|
1632
1632
|
const maxLineY = Math.min(ports.length, minLineY + visibleCount);
|
|
1633
|
-
const scrollBarHeight =
|
|
1633
|
+
const scrollBarHeight = listHeight === 0 || contentHeight <= listHeight ? 0 : Math.max(minimumScrollBarSize, listHeight * listHeight / contentHeight);
|
|
1634
1634
|
const scrollBarY = finalDeltaY === 0 ? 0 : deltaY / finalDeltaY * (listHeight - scrollBarHeight);
|
|
1635
1635
|
const calculated = {
|
|
1636
1636
|
...state,
|
|
@@ -2407,10 +2407,7 @@ const toggleRemoteSshPort = async (state, portNumber) => {
|
|
|
2407
2407
|
await invoke$1('Application.executeForView', uid, 'PortProvider.stopForwardPort', portNumber);
|
|
2408
2408
|
} else {
|
|
2409
2409
|
const forwardedPort = await invoke$1('Application.executeForView', uid, 'PortProvider.forwardPort', portNumber);
|
|
2410
|
-
if (!forwardedPort || typeof forwardedPort !== 'object' || !('localPort' in forwardedPort)) {
|
|
2411
|
-
throw new Error('Remote SSH returned an invalid local forwarding port');
|
|
2412
|
-
}
|
|
2413
|
-
if (!Number.isSafeInteger(forwardedPort.localPort) || Number(forwardedPort.localPort) < 1 || Number(forwardedPort.localPort) > 65_535) {
|
|
2410
|
+
if (!forwardedPort || typeof forwardedPort !== 'object' || !('localPort' in forwardedPort) || !Number.isSafeInteger(forwardedPort.localPort) || Number(forwardedPort.localPort) < 1 || Number(forwardedPort.localPort) > 65_535) {
|
|
2414
2411
|
throw new Error('Remote SSH returned an invalid local forwarding port');
|
|
2415
2412
|
}
|
|
2416
2413
|
forwardedAddress = `localhost:${forwardedPort.localPort}`;
|