Sticker View: Fix confilicting lottie animations
This commit is contained in:
parent
4c97d37439
commit
d2029a989f
@ -102,12 +102,10 @@ const AnimatedSticker: FC<OwnProps> = ({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const fullId = `${id || generateIdFor(ID_STORE, true)}_${size}${color ? `_${color.join(',')}` : ''}`;
|
|
||||||
|
|
||||||
const newAnimation = RLottie.init(
|
const newAnimation = RLottie.init(
|
||||||
containerRef.current,
|
containerRef.current,
|
||||||
onLoad,
|
onLoad,
|
||||||
fullId,
|
id || generateIdFor(ID_STORE, true),
|
||||||
tgsUrl,
|
tgsUrl,
|
||||||
{
|
{
|
||||||
noLoop,
|
noLoop,
|
||||||
|
|||||||
@ -99,6 +99,8 @@ const StickerView: FC<OwnProps> = ({
|
|||||||
// Preload preview for Message Input and local message
|
// Preload preview for Message Input and local message
|
||||||
useMedia(previewMediaHash, !shouldLoad || !shouldPreloadPreview, undefined, cacheBuster);
|
useMedia(previewMediaHash, !shouldLoad || !shouldPreloadPreview, undefined, cacheBuster);
|
||||||
|
|
||||||
|
const idKey = [id, size, customColor?.join(',')].filter(Boolean).join('_');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<img
|
<img
|
||||||
@ -108,8 +110,8 @@ const StickerView: FC<OwnProps> = ({
|
|||||||
/>
|
/>
|
||||||
{isLottie ? (
|
{isLottie ? (
|
||||||
<AnimatedSticker
|
<AnimatedSticker
|
||||||
key={customColor?.join(',')}
|
key={idKey}
|
||||||
id={id}
|
id={idKey}
|
||||||
size={size}
|
size={size}
|
||||||
className={buildClassName(styles.media, fullMediaClassName, fullMediaClassNames)}
|
className={buildClassName(styles.media, fullMediaClassName, fullMediaClassNames)}
|
||||||
tgsUrl={fullMediaData}
|
tgsUrl={fullMediaData}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user