diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index 2690613b..267804e7 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -448,6 +448,7 @@ "Write your colleagues name or email": "Write your colleague's name or email", "You can download multiple tracks at once in .mp3, .wav or .flac formats": "You can download multiple tracks at once in .mp3, .wav or .flac formats", "You can now login using your new password": "Теперь вы можете входить с помощью нового пароля", + "You can't edit this post": "You can't edit this post", "You were successfully authorized": "You were successfully authorized", "You ll be able to participate in discussions, rate others' comments and learn about new responses": "You ll be able to participate in discussions, rate others' comments and learn about new responses", "You've confirmed email": "You've confirmed email", diff --git a/public/locales/ru/translation.json b/public/locales/ru/translation.json index 2dc94b46..30e38a8d 100644 --- a/public/locales/ru/translation.json +++ b/public/locales/ru/translation.json @@ -471,6 +471,7 @@ "You can download multiple tracks at once in .mp3, .wav or .flac formats": "Можно загрузить сразу несколько треков в форматах .mp3, .wav или .flac", "You can now login using your new password": "Теперь вы можете входить с помощью нового пароля", "You was successfully authorized": "Вы были успешно авторизованы", + "You can't edit this post": "Вы не можете редактировать этот материал", "You ll be able to participate in discussions, rate others' comments and learn about new responses": "Вы сможете участвовать в обсуждениях, оценивать комментарии других и узнавать о новых ответах", "You've confirmed email": "Вы подтвердили почту", "You've reached a non-existed page": "Вы попали на несуществующую страницу", diff --git a/src/pages/edit.page.tsx b/src/pages/edit.page.tsx index 6b33a92f..21353681 100644 --- a/src/pages/edit.page.tsx +++ b/src/pages/edit.page.tsx @@ -37,7 +37,8 @@ export const EditPage = () => { const fail = async (error: string) => { console.error(error) - await snackbar?.showSnackbar({ type: 'error', body: t(error) }) + const errorMessage = error === 'forbidden' ? "You can't edit this post" : error + await snackbar?.showSnackbar({ type: 'error', body: t(errorMessage) }) redirectPage(router, 'drafts') }