Skip to content

Commit d16b598

Browse files
committed
feat: add msg when checking disqus availability
1 parent 8b382b1 commit d16b598

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/disqus.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@
141141
}
142142

143143
function checkDisqus() {
144+
$$('disqus_thread').innerHTML = `<div id="dsqjs"><section><div id="dsqjs-msg">正在检查 Disqus 能否访问...</div></section><footer><p class="dsqjs-footer">Powered by <a class="dsqjs-disqus-logo" href="https://disqus.com" rel="nofollow noopener noreferrer" target="_blank"></a>&nbsp;&amp;&nbsp;<a href="https://github.com/SukkaW/DisqusJS" target="_blank">DisqusJS</a></p></footer></div>`;
145+
144146
// 测试 Disqus 的域名
145147
// *.disquscdn.com 没有被墙所以不做检查
146148
let domain = ['disqus.com', `${disqusjs.config.shortname}.disqus.com`],
@@ -150,7 +152,7 @@
150152
let checker = () => {
151153
// 测试域名数量 ==== 测试次数 === 成功次数
152154
// 如果 truw 则认定可以 Disqus 可以连通
153-
if (domain.length === test === success) {
155+
if (domain.length === test && test === success) {
154156
forceDisqus()
155157
// 否则认为 Disqus 无法连通
156158
} else if (domain.length === test) {

0 commit comments

Comments
 (0)