mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-11 22:06:17 +00:00
Compare commits
11 Commits
feat/disab
...
feat/LBX-1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
96b12cb27e | ||
|
|
a01e1b1709 | ||
|
|
60fd90820c | ||
|
|
798f88618e | ||
|
|
40795c34dc | ||
|
|
e335e05628 | ||
|
|
05464f25df | ||
|
|
b9830afca1 | ||
|
|
1cab73bcb4 | ||
|
|
387b3ebeac | ||
|
|
1545f42d17 |
@@ -10,6 +10,7 @@
|
||||
|
||||
[](https://github.com/hydralauncher/hydra/actions)
|
||||
[](https://github.com/hydralauncher/hydra/releases)
|
||||
[](https://community.chocolatey.org/packages/hydralauncher)
|
||||
|
||||

|
||||
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
transition: all ease 0.2s;
|
||||
position: relative;
|
||||
opacity: 0.4;
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
|
||||
&:hover {
|
||||
background-color: rgba(255, 255, 255, 0.03);
|
||||
@@ -40,12 +42,17 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: globals.$background-color;
|
||||
color: #fff;
|
||||
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
svg {
|
||||
color: inherit;
|
||||
}
|
||||
}
|
||||
|
||||
&__badge-picture {
|
||||
|
||||
@@ -130,6 +130,32 @@ export default function Notifications() {
|
||||
return () => unsubscribe();
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
const unsubscribe = window.electron.onSyncNotificationCount(() => {
|
||||
if (userDetails) {
|
||||
fetchApiNotifications(0, false);
|
||||
}
|
||||
fetchLocalNotifications();
|
||||
});
|
||||
|
||||
return () => unsubscribe();
|
||||
}, [userDetails, fetchApiNotifications, fetchLocalNotifications]);
|
||||
|
||||
useEffect(() => {
|
||||
const handleVisibilityChange = () => {
|
||||
if (!document.hidden && userDetails) {
|
||||
fetchApiNotifications(0, false);
|
||||
fetchLocalNotifications();
|
||||
}
|
||||
};
|
||||
|
||||
document.addEventListener("visibilitychange", handleVisibilityChange);
|
||||
|
||||
return () => {
|
||||
document.removeEventListener("visibilitychange", handleVisibilityChange);
|
||||
};
|
||||
}, [userDetails, fetchApiNotifications, fetchLocalNotifications]);
|
||||
|
||||
const mergedNotifications = useMemo<MergedNotification[]>(() => {
|
||||
const sortByDate = (a: MergedNotification, b: MergedNotification) =>
|
||||
new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime();
|
||||
|
||||
@@ -116,5 +116,6 @@
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user