Fix Changyan on Pjax sites (#252)

This commit is contained in:
2021-04-20 17:09:31 +08:00 committed by GitHub
parent 9f0be6848a
commit c95976dd19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,7 +8,11 @@ document.addEventListener('page:loaded', () => {
);
} else if (CONFIG.page.comments) {
NexT.utils.loadComments('#SOHUCS')
.then(() => NexT.utils.getScript('https://changyan.sohu.com/upload/changyan.js'))
.then(() => {
delete window.changyan;
delete window.cyan;
return NexT.utils.getScript('https://changyan.sohu.com/upload/changyan.js');
})
.then(() => {
window.changyan.api.config({
appid: CONFIG.changyan.appid,