Fix notification not showing all

This commit is contained in:
Gregory Schier
2025-03-12 06:41:53 -07:00
parent 0828599e4f
commit be11d5968e
2 changed files with 6 additions and 19 deletions

View File

@@ -93,11 +93,12 @@ impl YaakNotifier {
let seen = get_kv(window).await?;
if seen.contains(&notification.id) || (age > Duration::days(2)) {
debug!("Already seen notification {}", notification.id);
return Ok(());
continue;
}
debug!("Got notification {:?}", notification);
let _ = window.emit_to(window.label(), "notification", notification.clone());
break; // Only show one notification
}
Ok(())

View File

@@ -2,32 +2,19 @@ import type { LicenseCheckStatus } from '@yaakapp-internal/license';
import { useLicense } from '@yaakapp-internal/license';
import type { ReactNode } from 'react';
import { openSettings } from '../commands/openSettings';
import { appInfo } from '../hooks/useAppInfo';
import { useLicenseConfirmation } from '../hooks/useLicenseConfirmation';
import type { ButtonProps } from './core/Button';
import { Button } from './core/Button';
import { Icon } from './core/Icon';
import { HStack } from './core/Stacks';
import { SettingsTab } from './Settings/SettingsTab';
const details: Record<
LicenseCheckStatus['type'] | 'dev' | 'beta',
LicenseCheckStatus['type'],
{ label: ReactNode; color: ButtonProps['color'] } | null
> = {
beta: {
label: (
<HStack space={1}>
<span>Beta Feedback</span>
<Icon size="xs" icon="external_link" />
</HStack>
),
color: 'info',
},
dev: { label: 'Develop', color: 'secondary' },
commercial_use: null,
invalid_license: { label: 'License Error', color: 'danger' },
personal_use: { label: 'Personal Use', color: 'success' },
trialing: { label: 'Personal Use', color: 'success' },
personal_use: { label: 'Personal Use', color: 'notice' },
trialing: { label: 'Personal Use', color: 'notice' },
};
export function LicenseBadge() {
@@ -62,8 +49,7 @@ export function LicenseBadge() {
return null;
}
const checkType = appInfo.version.includes('beta') ? 'beta' : check.data.type;
const detail = details[checkType];
const detail = details[check.data.type];
if (detail == null) {
return null;
}