Skip to content

Commit 9a26290

Browse files
committed
fix: don't show "Translate with AI" button, if completion adapter is not provided
https://web.tracklify.com/project/2b7ZVgE5/AdminForth/1287/xvSRxSwT/add-a-progress-box-for-transla
1 parent c191318 commit 9a26290

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,8 +484,9 @@ export default class I18nPlugin extends AdminForthPlugin {
484484
if (!resourceConfig.options.pageInjections.list.threeDotsDropdownItems) {
485485
resourceConfig.options.pageInjections.list.threeDotsDropdownItems = [];
486486
}
487-
488-
(resourceConfig.options.pageInjections.list.threeDotsDropdownItems as AdminForthComponentDeclaration[]).push(pageInjection);
487+
if (this.options.completeAdapter) {
488+
(resourceConfig.options.pageInjections.list.threeDotsDropdownItems as AdminForthComponentDeclaration[]).push(pageInjection);
489+
}
489490

490491
// if there is menu item with resourceId, add .badge function showing number of untranslated strings
491492
const addBadgeCountToMenuItem = (menuItem: AdminForthConfigMenuItem) => {

0 commit comments

Comments
 (0)