fix: Toast not aligned to the bottom when AI assistant disable (#11549)

This commit is contained in:
Ricardo Espinoza 2024-11-05 06:52:52 -05:00 committed by GitHub
parent 38da319507
commit e80f7e0a02
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -10,6 +10,7 @@ import { useExternalHooks } from './useExternalHooks';
import { VIEWS } from '@/constants';
import type { ApplicationError } from 'n8n-workflow';
import { useStyles } from './useStyles';
import { useSettingsStore } from '@/stores/settings.store';
export interface NotificationErrorWithNodeAndDescription extends ApplicationError {
node: {
@ -26,13 +27,14 @@ export function useToast() {
const uiStore = useUIStore();
const externalHooks = useExternalHooks();
const i18n = useI18n();
const settingsStore = useSettingsStore();
const { APP_Z_INDEXES } = useStyles();
const messageDefaults: Partial<Omit<NotificationOptions, 'message'>> = {
dangerouslyUseHTMLString: false,
position: 'bottom-right',
zIndex: APP_Z_INDEXES.TOASTS, // above NDV and modal overlays
offset: 64,
offset: settingsStore.isAiAssistantEnabled ? 64 : 0,
appendTo: '#app-grid',
customClass: 'content-toast',
};