Skip to content
Snippets Groups Projects
Unverified Commit 1b390c72 authored by Tiago Evangelista Pinto's avatar Tiago Evangelista Pinto Committed by GitHub
Browse files

fix: Client check `AutoTranslate_Enabled` setting before a server endpoint call (#32221)

parent 6b053aed
No related branches found
Tags 6.1.7
No related merge requests found
---
"@rocket.chat/meteor": patch
---
Fixed an issue where an endpoint was called before checking configuration that enables automatic translation when launching the application
...@@ -17,6 +17,7 @@ import { ...@@ -17,6 +17,7 @@ import {
} from '../../../../client/views/room/MessageList/lib/autoTranslate'; } from '../../../../client/views/room/MessageList/lib/autoTranslate';
import { hasPermission } from '../../../authorization/client'; import { hasPermission } from '../../../authorization/client';
import { Subscriptions, Messages } from '../../../models/client'; import { Subscriptions, Messages } from '../../../models/client';
import { settings } from '../../../settings/client';
import { sdk } from '../../../utils/client/lib/SDKClient'; import { sdk } from '../../../utils/client/lib/SDKClient';
let userLanguage = 'en'; let userLanguage = 'en';
...@@ -102,7 +103,7 @@ export const AutoTranslate = { ...@@ -102,7 +103,7 @@ export const AutoTranslate = {
Tracker.autorun(async (c) => { Tracker.autorun(async (c) => {
const uid = Meteor.userId(); const uid = Meteor.userId();
if (!uid || !hasPermission('auto-translate')) { if (!settings.get('AutoTranslate_Enabled') || !uid || !hasPermission('auto-translate')) {
return; return;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment