Skip to content

Commit

Permalink
adicionado condição
Browse files Browse the repository at this point in the history
  • Loading branch information
lelemm committed Feb 3, 2025
1 parent cd51f0a commit 46848c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import { Select, type SelectOption } from '../common/Select';
import { Text } from '../common/Text';

import { Setting } from './UI';
import { useAuth } from '../../auth/AuthProvider';
import { Permissions } from '../../auth/types';

const languageOptions = (t: TFunction): SelectOption[] =>
[
Expand All @@ -29,8 +31,9 @@ export function LanguageSettings() {
const { t } = useTranslation();
const [language, setLanguage] = useGlobalPref('language');
const isEnabled = !!availableLanguages.length;
const { hasPermission } = useAuth();

return (
return hasPermission(Permissions.ADMINISTRATOR) ? (
<Setting
primaryAction={
<Select
Expand Down Expand Up @@ -82,5 +85,5 @@ export function LanguageSettings() {
)}
</Text>
</Setting>
);
) : <></>;
}
2 changes: 1 addition & 1 deletion packages/desktop-client/src/components/settings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export function Settings() {
<About />
<ThemeSettings />
<FormatSettings />
{/* <LanguageSettings /> */}
<LanguageSettings />
<AuthSettings />
<EncryptionSettings />
<BudgetTypeSettings />
Expand Down

0 comments on commit 46848c2

Please sign in to comment.