mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-15 04:32:13 +00:00
Merge branch 'feature/game-achievements' into chore/test-preview
This commit is contained in:
commit
0895e9ec72
1 changed files with 3 additions and 1 deletions
|
@ -8,6 +8,8 @@ interface AchievementInfo {
|
||||||
iconUrl: string;
|
iconUrl: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const NOTIFICATION_TIMEOUT = 4000;
|
||||||
|
|
||||||
export function Achievement() {
|
export function Achievement() {
|
||||||
const { t } = useTranslation("achievement");
|
const { t } = useTranslation("achievement");
|
||||||
|
|
||||||
|
@ -77,7 +79,7 @@ export function Achievement() {
|
||||||
cancelAnimationFrame(achievementAnimation.current);
|
cancelAnimationFrame(achievementAnimation.current);
|
||||||
achievementAnimation.current = requestAnimationFrame(
|
achievementAnimation.current = requestAnimationFrame(
|
||||||
function animateLock(time) {
|
function animateLock(time) {
|
||||||
if (time - zero > 2500) {
|
if (time - zero > NOTIFICATION_TIMEOUT) {
|
||||||
zero = performance.now();
|
zero = performance.now();
|
||||||
setAchievements((ach) => ach.slice(1));
|
setAchievements((ach) => ach.slice(1));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue