Commit d3d43618 authored by timel's avatar timel

fix: animation sequence

parent cedf08a2
Pipeline #21975 passed with stages
in 14 minutes and 59 seconds
......@@ -71,15 +71,13 @@ export const Card: FC<{ idx: number }> = React.memo(({ idx }) => {
// >>> 动画 >>>
/** 动画序列的promise,当不是undefined,就说明现在这个卡有动画 */
let animation: Promise<void> | null = null;
let animation: Promise<unknown> | null = null;
const play = (p: () => Promise<void>) => {
const play = (p: () => Promise<unknown>) => {
if (animation) {
animation = animation.then(p).then(() => {
animation = null;
});
animation = animation.then(p).then(() => (animation = null));
} else {
animation = p();
animation = p().then(() => (animation = null));
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment