mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-16 01:24:05 -08:00
71ae6c66ef
* 🐛 Fix unique names for node duplication * 🐛 Fix i18n references
26 lines
820 B
TypeScript
26 lines
820 B
TypeScript
import type { BaseTextKey } from '@/plugins/i18n';
|
|
import { useUIStore, useUsageStore } from '@/stores';
|
|
import { useI18n } from '@/composables';
|
|
import { computed } from 'vue';
|
|
|
|
export function useUpgradeLink(queryParams = { default: '', desktop: '' }) {
|
|
const uiStore = useUIStore();
|
|
const usageStore = useUsageStore();
|
|
const { i18n } = useI18n();
|
|
|
|
const upgradeLinkUrl = computed(() => {
|
|
const linkUrlTranslationKey = uiStore.contextBasedTranslationKeys.upgradeLinkUrl as BaseTextKey;
|
|
let url = i18n.baseText(linkUrlTranslationKey);
|
|
|
|
if (linkUrlTranslationKey.endsWith('.upgradeLinkUrl')) {
|
|
url = `${usageStore.viewPlansUrl}${queryParams.default}`;
|
|
} else if (linkUrlTranslationKey.endsWith('.desktop')) {
|
|
url = `${url}${queryParams.desktop}`;
|
|
}
|
|
|
|
return url;
|
|
});
|
|
|
|
return { upgradeLinkUrl };
|
|
}
|