Skip to content

Commit 6215182

Browse files
author
Affolter Matias
committed
Lottie
1 parent 1b926de commit 6215182

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

‎client/chunk_main_af9f4ef7.min.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎service-worker.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use strict";
2-
var REQUIRED_CACHE = "unless-update-cache-v897-required";
3-
var USEFUL_CACHE = "unless-update-cache-v897-useful";
4-
var STATIC_CACHE = "unless-update-cache-v897-static";
2+
var REQUIRED_CACHE = "unless-update-cache-v898-required";
3+
var USEFUL_CACHE = "unless-update-cache-v898-useful";
4+
var STATIC_CACHE = "unless-update-cache-v898-static";
55
var MAIN_CHILD_CHUNK_REGEX = /chunk_(main_[a-z0-9]+)\.min\.js$/i;
66
var CHILD_CHUNK_REGEX = /chunk_([0-9]+)\.min\.js$/i;
77

‎src/js/components/Lottie.js‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Lottie extends React.PureComponent {
2929
autoplay: props.autoplay || false,
3030
path: props.path || props.src || "",
3131
initialSegment: props.initialSegment,
32-
id: "n"+props.id || "n"+(Math.random()*10000|0).toString(16),
32+
id: "n"+props.id || "n"+(Math.random()*65553|0).toString(16),
3333
};
3434
this._lottie;
3535
};
@@ -50,7 +50,7 @@ class Lottie extends React.PureComponent {
5050
container: document.getElementById(id),
5151
loop: loop,
5252
autoplay: autoplay,
53-
quality: "high",
53+
quality: "medium",
5454
path: path,
5555
name: id,
5656
hover: hover,
@@ -60,8 +60,12 @@ class Lottie extends React.PureComponent {
6060

6161
componentWillUnmount() {
6262

63-
this._lottie.destroy(this.state.id);
64-
delete this._lottie;
63+
if(typeof this._lottie != "undefined"){
64+
if(this._lottie !== null) {
65+
this._lottie.destroy(this.state.id);
66+
delete this._lottie;
67+
}
68+
}
6569
}
6670

6771
render() {

0 commit comments

Comments
 (0)