Upgrade Electron to 28.1.5
Co-authored-by: Fedor Indutny <238531+indutny@users.noreply.github.com>
This commit is contained in:
parent
d97aa68716
commit
2bc0e4755c
24 changed files with 421 additions and 296 deletions
|
@ -26,6 +26,7 @@ import { isGIF } from '../types/Attachment';
|
|||
import { useRestoreFocus } from '../hooks/useRestoreFocus';
|
||||
import { usePrevious } from '../hooks/usePrevious';
|
||||
import { arrow } from '../util/keyboard';
|
||||
import { drop } from '../util/drop';
|
||||
import { isCmdOrCtrl } from '../hooks/useKeyboardShortcuts';
|
||||
|
||||
export type PropsType = {
|
||||
|
@ -327,10 +328,14 @@ export function Lightbox({
|
|||
(selectedIndex === 0 ? 1 : -1) * THUMBNAIL_FULL_WIDTH,
|
||||
opacity: 0,
|
||||
});
|
||||
thumbnailsAnimation.start({
|
||||
marginInlineStart: thumbnailsMarginInlineStart,
|
||||
opacity: 1,
|
||||
});
|
||||
drop(
|
||||
Promise.all(
|
||||
thumbnailsAnimation.start({
|
||||
marginInlineStart: thumbnailsMarginInlineStart,
|
||||
opacity: 1,
|
||||
})
|
||||
)
|
||||
);
|
||||
}, [
|
||||
needsAnimation,
|
||||
selectedIndex,
|
||||
|
@ -375,11 +380,15 @@ export function Lightbox({
|
|||
const posY = offsetY * ZOOM_SCALE;
|
||||
const [x, y] = maxBoundsLimiter(posX, posY);
|
||||
|
||||
springApi.start({
|
||||
scale: ZOOM_SCALE,
|
||||
translateX: shouldTranslateX ? x : undefined,
|
||||
translateY: shouldTranslateY ? y : undefined,
|
||||
});
|
||||
drop(
|
||||
Promise.all(
|
||||
springApi.start({
|
||||
scale: ZOOM_SCALE,
|
||||
translateX: shouldTranslateX ? x : undefined,
|
||||
translateY: shouldTranslateY ? y : undefined,
|
||||
})
|
||||
)
|
||||
);
|
||||
},
|
||||
[maxBoundsLimiter, springApi]
|
||||
);
|
||||
|
@ -414,11 +423,15 @@ export function Lightbox({
|
|||
const x = dragCache.translateX + deltaX;
|
||||
const y = dragCache.translateY + deltaY;
|
||||
|
||||
springApi.start({
|
||||
scale: ZOOM_SCALE,
|
||||
translateX: x,
|
||||
translateY: y,
|
||||
});
|
||||
drop(
|
||||
Promise.all(
|
||||
springApi.start({
|
||||
scale: ZOOM_SCALE,
|
||||
translateX: x,
|
||||
translateY: y,
|
||||
})
|
||||
)
|
||||
);
|
||||
},
|
||||
[springApi]
|
||||
);
|
||||
|
@ -459,15 +472,19 @@ export function Lightbox({
|
|||
const posY = -offsetY * ZOOM_SCALE + translateY.get();
|
||||
const [x, y] = maxBoundsLimiter(posX, posY);
|
||||
|
||||
springApi.start({
|
||||
scale: ZOOM_SCALE,
|
||||
translateX: shouldTranslateX ? x : undefined,
|
||||
translateY: shouldTranslateY ? y : undefined,
|
||||
});
|
||||
drop(
|
||||
Promise.all(
|
||||
springApi.start({
|
||||
scale: ZOOM_SCALE,
|
||||
translateX: shouldTranslateX ? x : undefined,
|
||||
translateY: shouldTranslateY ? y : undefined,
|
||||
})
|
||||
)
|
||||
);
|
||||
|
||||
setIsZoomed(true);
|
||||
} else {
|
||||
springApi.start(INITIAL_IMAGE_TRANSFORM);
|
||||
drop(Promise.all(springApi.start(INITIAL_IMAGE_TRANSFORM)));
|
||||
setIsZoomed(false);
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue