Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
fix: script error when countdown is 0.
Browse files Browse the repository at this point in the history
  • Loading branch information
ulivz committed Mar 28, 2020
1 parent 9894094 commit ec8020e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,12 @@ function getDirectHtml({ /* url, */redirectUrl, countdown, routerBase = '/' } =
<script>
var el = document.getElementById("countdown");
var isIE = navigator.appName.indexOf("Explorer") > -1;
var countdown = isIE ? el.innerText : el.textContent;
var routerBase = window.routerBase || ${JSON.stringify(routerBase)};
var isInternalDirect = ${JSON.stringify(isInternalUrl)};
var redirectUrl = ${JSON.stringify(redirectUrl)};
var countdown = el
? (isIE ? el.innerText : el.textContent)
: 0;
function redirect() {
if (countdown <= 0) {
Expand Down

0 comments on commit ec8020e

Please sign in to comment.