mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-24 09:38:29 +02:00
Fix notification not showing all
This commit is contained in:
@@ -93,11 +93,12 @@ impl YaakNotifier {
|
|||||||
let seen = get_kv(window).await?;
|
let seen = get_kv(window).await?;
|
||||||
if seen.contains(¬ification.id) || (age > Duration::days(2)) {
|
if seen.contains(¬ification.id) || (age > Duration::days(2)) {
|
||||||
debug!("Already seen notification {}", notification.id);
|
debug!("Already seen notification {}", notification.id);
|
||||||
return Ok(());
|
continue;
|
||||||
}
|
}
|
||||||
debug!("Got notification {:?}", notification);
|
debug!("Got notification {:?}", notification);
|
||||||
|
|
||||||
let _ = window.emit_to(window.label(), "notification", notification.clone());
|
let _ = window.emit_to(window.label(), "notification", notification.clone());
|
||||||
|
break; // Only show one notification
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|||||||
@@ -2,32 +2,19 @@ import type { LicenseCheckStatus } from '@yaakapp-internal/license';
|
|||||||
import { useLicense } from '@yaakapp-internal/license';
|
import { useLicense } from '@yaakapp-internal/license';
|
||||||
import type { ReactNode } from 'react';
|
import type { ReactNode } from 'react';
|
||||||
import { openSettings } from '../commands/openSettings';
|
import { openSettings } from '../commands/openSettings';
|
||||||
import { appInfo } from '../hooks/useAppInfo';
|
|
||||||
import { useLicenseConfirmation } from '../hooks/useLicenseConfirmation';
|
import { useLicenseConfirmation } from '../hooks/useLicenseConfirmation';
|
||||||
import type { ButtonProps } from './core/Button';
|
import type { ButtonProps } from './core/Button';
|
||||||
import { Button } from './core/Button';
|
import { Button } from './core/Button';
|
||||||
import { Icon } from './core/Icon';
|
|
||||||
import { HStack } from './core/Stacks';
|
|
||||||
import { SettingsTab } from './Settings/SettingsTab';
|
import { SettingsTab } from './Settings/SettingsTab';
|
||||||
|
|
||||||
const details: Record<
|
const details: Record<
|
||||||
LicenseCheckStatus['type'] | 'dev' | 'beta',
|
LicenseCheckStatus['type'],
|
||||||
{ label: ReactNode; color: ButtonProps['color'] } | null
|
{ 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,
|
commercial_use: null,
|
||||||
invalid_license: { label: 'License Error', color: 'danger' },
|
invalid_license: { label: 'License Error', color: 'danger' },
|
||||||
personal_use: { label: 'Personal Use', color: 'success' },
|
personal_use: { label: 'Personal Use', color: 'notice' },
|
||||||
trialing: { label: 'Personal Use', color: 'success' },
|
trialing: { label: 'Personal Use', color: 'notice' },
|
||||||
};
|
};
|
||||||
|
|
||||||
export function LicenseBadge() {
|
export function LicenseBadge() {
|
||||||
@@ -62,8 +49,7 @@ export function LicenseBadge() {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const checkType = appInfo.version.includes('beta') ? 'beta' : check.data.type;
|
const detail = details[check.data.type];
|
||||||
const detail = details[checkType];
|
|
||||||
if (detail == null) {
|
if (detail == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user