diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index 5dfd02bb..cc47cdd3 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -378,6 +378,7 @@ "There are unsaved changes in your profile settings. Are you sure you want to leave the page without saving?": "There are unsaved changes in your profile settings. Are you sure you want to leave the page without saving?", "There are unsaved changes in your publishing settings. Are you sure you want to leave the page without saving?": "There are unsaved changes in your publishing settings. Are you sure you want to leave the page without saving?", "This comment has not yet been rated": "This comment has not yet been rated", + "This content is not published yet": "This content is not published yet", "This email is": "This email is", "This email is not verified": "This email is not verified", "This email is verified": "This email is verified", diff --git a/public/locales/ru/translation.json b/public/locales/ru/translation.json index 573b313c..1c6e5596 100644 --- a/public/locales/ru/translation.json +++ b/public/locales/ru/translation.json @@ -148,6 +148,7 @@ "Enter the code or click the link from email to confirm": "Введите код из письма или пройдите по ссылке в письме для подтверждения регистрации", "Enter your new password": "Введите новый пароль", "Enter": "Войти", + "This content is not published yet": "Содержимое ещё не опубликовано", "Error": "Ошибка", "Please give us your email address": "Пожалуйста, укажите свою почту, чтобы получить ссылку для сброса пароля", "Experience": "Личный опыт", diff --git a/src/components/Inbox/DialogAvatar.tsx b/src/components/Inbox/DialogAvatar.tsx index 1e2d68e4..d34067d6 100644 --- a/src/components/Inbox/DialogAvatar.tsx +++ b/src/components/Inbox/DialogAvatar.tsx @@ -51,10 +51,15 @@ const DialogAvatar = (props: Props) => { {nameFirstLetter()}}>
diff --git a/src/pages/edit.page.tsx b/src/pages/edit.page.tsx index f4b7fd00..c2aa7b4b 100644 --- a/src/pages/edit.page.tsx +++ b/src/pages/edit.page.tsx @@ -9,13 +9,15 @@ import { Shout } from '../graphql/schema/core.gen' import { useRouter } from '../stores/router' import { router } from '../stores/router' +import { redirectPage } from '@nanostores/router' +import { useSnackbar } from '../context/snackbar' import { LayoutType } from './types' -import { redirectPage } from "@nanostores/router"; const EditView = lazy(() => import('../components/Views/EditView/EditView')) export const EditPage = () => { const { page } = useRouter() + const snackbar = useSnackbar() const { t } = useLocalize() const shoutId = createMemo(() => Number((page().params as Record<'shoutId', string>).shoutId)) @@ -27,8 +29,8 @@ export const EditPage = () => { console.log(loadedShout) if (loadedShout) { setShout(loadedShout) - } - else { + } else { + await snackbar?.showSnackbar({ type: 'error', body: t('This content is not published yet') }) redirectPage(router, 'drafts') } })