mirror of
https://github.com/paricafe/misskey.git
synced 2024-11-24 14:06:44 -06:00
Merge branch 'develop' into pari-20241009
This commit is contained in:
commit
43d6f842e3
2 changed files with 34 additions and 3 deletions
|
@ -7,7 +7,8 @@
|
|||
### Client
|
||||
- Enhance: Bull DashboardでRelationship Queueの状態も確認できるように
|
||||
(Cherry-picked from https://github.com/MisskeyIO/misskey/pull/751)
|
||||
- Enhance: ドライブでソートができるように
|
||||
- Enhance: ドライブでソートができるように
|
||||
- Enhance: 「単なるラッキー」の取得条件を変更
|
||||
- Enhance: 投稿フォームでEscキーを押したときIME入力中ならフォームを閉じないように( #10866 )
|
||||
- Fix: 通知の範囲指定の設定項目が必要ない通知設定でも範囲指定の設定がでている問題を修正
|
||||
- Fix: Turnstileが失敗・期限切れした際にも成功扱いとなってしまう問題を修正
|
||||
|
|
|
@ -231,11 +231,41 @@ export async function mainBoot() {
|
|||
}
|
||||
|
||||
if (!claimedAchievements.includes('justPlainLucky')) {
|
||||
window.setInterval(() => {
|
||||
let justPlainLuckyTimer: number | null = null;
|
||||
let lastVisibilityChangedAt = Date.now();
|
||||
|
||||
function claimPlainLucky() {
|
||||
if (document.visibilityState !== 'visible') {
|
||||
if (justPlainLuckyTimer != null) window.clearTimeout(justPlainLuckyTimer);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Math.floor(Math.random() * 20000) === 0) {
|
||||
claimAchievement('justPlainLucky');
|
||||
} else {
|
||||
justPlainLuckyTimer = window.setTimeout(claimPlainLucky, 1000 * 10);
|
||||
}
|
||||
}, 1000 * 10);
|
||||
}
|
||||
|
||||
window.addEventListener('visibilitychange', () => {
|
||||
const now = Date.now();
|
||||
|
||||
if (document.visibilityState === 'visible') {
|
||||
// タブを高速で切り替えたら取得処理が何度も走るのを防ぐ
|
||||
if ((now - lastVisibilityChangedAt) < 1000 * 10) {
|
||||
justPlainLuckyTimer = window.setTimeout(claimPlainLucky, 1000 * 10);
|
||||
} else {
|
||||
claimPlainLucky();
|
||||
}
|
||||
} else if (justPlainLuckyTimer != null) {
|
||||
window.clearTimeout(justPlainLuckyTimer);
|
||||
justPlainLuckyTimer = null;
|
||||
}
|
||||
|
||||
lastVisibilityChangedAt = now;
|
||||
}, { passive: true });
|
||||
|
||||
claimPlainLucky();
|
||||
}
|
||||
|
||||
if (!claimedAchievements.includes('client30min')) {
|
||||
|
|
Loading…
Reference in a new issue