Fix hot reload infinite loop and graceful degradation for Duolingo badge API block

This commit is contained in:
User
2026-03-12 16:05:56 +08:00
parent 3eaef5b06a
commit 0387c7d9e5
3 changed files with 11 additions and 10 deletions

View File

@@ -670,6 +670,11 @@ $author_desc = get_option('argon_sidebar_author_description');
<span class="duolingo-streak<?php echo $is_today_done ? '' : ' not-done'; ?>"<?php echo $tooltip_attr; ?>>
<img src="<?php echo get_template_directory_uri(); ?>/assets/icons/duolingo-streak<?php echo $is_today_done ? '' : '-empty'; ?>.svg" class="duolingo-flame" alt="streak">
<?php echo $duo_data['streak']; ?>
</span>
<?php else: ?>
<span class="duolingo-streak not-done" data-toggle="tooltip" data-placement="bottom" title="<?php _e('API 获取失败 / 用户名错误 / 或被频控拦截', 'argon'); ?>">
<img src="<?php echo get_template_directory_uri(); ?>/assets/icons/duolingo-streak-empty.svg" class="duolingo-flame" alt="streak">
?
</span>
<?php endif; endif; ?>
</h6>