mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-04-12 16:05:35 -04:00
better typing
This commit is contained in:
@@ -37,16 +37,17 @@ export function useAnnouncements() {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
const newAnnouncements = shallowRef<Announcement[]>([]);
|
|
||||||
function refreshUnreadAnnouncements() {
|
function refreshUnreadAnnouncements() {
|
||||||
|
const user = auth.user.value;
|
||||||
|
|
||||||
// Only logged-in users can see announcements
|
// Only logged-in users can see announcements
|
||||||
if (!auth.user.value || !allAnnouncements.length) {
|
if (!user || !allAnnouncements.length) {
|
||||||
newAnnouncements.value = [];
|
newAnnouncements.value = [];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If a user has never seen an announcement, show them only the welcome announcement
|
// If a user has never seen an announcement, show them only the welcome announcement
|
||||||
if (!auth.user.value.lastReadAnnouncement) {
|
if (!user.lastReadAnnouncement) {
|
||||||
newAnnouncements.value = [allAnnouncements.at(0)!];
|
newAnnouncements.value = [allAnnouncements.at(0)!];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user