diff --git a/components/Application/UserSettings/UserSettings.tsx b/components/Application/UserSettings/UserSettings.tsx index f56c544..5f873f3 100644 --- a/components/Application/UserSettings/UserSettings.tsx +++ b/components/Application/UserSettings/UserSettings.tsx @@ -84,7 +84,10 @@ export const UserSettings: React.FC = () => { return { ...oldUser, ...userCurrentData, - settings: userCurrentSettings.settings + settings: { + ...oldUser.settings, + ...userCurrentSettings.settings + } } }) return { diff --git a/locales/en/application.json b/locales/en/application.json index 49380a1..23b3169 100644 --- a/locales/en/application.json +++ b/locales/en/application.json @@ -2,6 +2,7 @@ "website": "Website", "create": "Create", "status": "Status", + "create-a-channel": "Create a channel", "create-a-guild": "Create a Guild", "create-a-guild-description": "Create your own guild and manage everything.", "join-a-guild": "Join a Guild", diff --git a/locales/fr/application.json b/locales/fr/application.json index 11e1832..5e95c80 100644 --- a/locales/fr/application.json +++ b/locales/fr/application.json @@ -2,6 +2,7 @@ "website": "Site web", "create": "Créer", "status": "Statut", + "create-a-channel": "Créer un channel", "create-a-guild": "Créer une Guilde", "create-a-guild-description": "Créez votre propre guilde et gérez tout.", "join-a-guild": "Rejoindre une Guilde", diff --git a/pages/application/[guildId]/channels/create.tsx b/pages/application/[guildId]/channels/create.tsx index ff80d92..90ae802 100644 --- a/pages/application/[guildId]/channels/create.tsx +++ b/pages/application/[guildId]/channels/create.tsx @@ -1,4 +1,5 @@ import { NextPage } from 'next' +import useTranslation from 'next-translate/useTranslation' import { Head } from '../../../../components/Head' import { Application } from '../../../../components/Application' @@ -21,6 +22,7 @@ export interface CreateChannelPageProps extends PagePropsWithAuthentication { const CreateChannelPage: NextPage = (props) => { const { guildId, authentication, guildMember } = props + const { t } = useTranslation() const path = { guildId } @@ -29,10 +31,10 @@ const CreateChannelPage: NextPage = (props) => { - + diff --git a/tools/authentication/AuthenticationContext.tsx b/tools/authentication/AuthenticationContext.tsx index 0b75d8d..0a49367 100644 --- a/tools/authentication/AuthenticationContext.tsx +++ b/tools/authentication/AuthenticationContext.tsx @@ -5,7 +5,6 @@ import useTranslation from 'next-translate/useTranslation' import { Authentication, PagePropsWithAuthentication } from '.' import { UserCurrent } from '../../models/User' -import { Language, Theme } from '../../models/UserSettings' export interface AuthenticationValue { authentication: Authentication @@ -41,14 +40,13 @@ export const AuthenticationProvider: React.FC = ( useEffect(() => { authentication.api .put('/users/current/settings', { theme, language: lang }) - .then(() => { + .then(({ data: userCurrentSettings }) => { setUser((oldUser) => { return { ...oldUser, settings: { ...oldUser.settings, - theme: theme as Theme, - language: lang as Language + ...userCurrentSettings.settings } } })