Change publish btn action

This commit is contained in:
ilya-bkv 2024-02-12 11:12:23 +03:00
parent b3e3068a8d
commit 88ecd906f9
2 changed files with 2 additions and 12 deletions

View File

@ -47,11 +47,6 @@ export const Panel = (props: Props) => {
const handleSaveClick = () => {
saveShout(form)
}
const { showSnackbar } = useSnackbar()
const handlePublishClick = () => {
if (form.mainTopic) publishShout(form)
else showSnackbar({ body: t('Please, set the main topic first') })
}
const html = useEditorHTML(() => editorRef.current())
@ -74,7 +69,7 @@ export const Panel = (props: Props) => {
<div class={clsx(styles.actionsHolder, styles.scrolled, { hidden: isShortcutsVisible() })}>
<section>
<p>
<span class={styles.link} onClick={handlePublishClick}>
<span class={styles.link} onClick={() => publishShout(form)}>
{t('Publish')}
</span>
</p>

View File

@ -63,11 +63,6 @@ export const HeaderAuth = (props: Props) => {
const handleSaveButtonClick = () => {
saveShout(form)
}
const { showSnackbar } = useSnackbar()
const handlePublishButtonClick = () => {
if (form.mainTopic) publishShout(form)
else showSnackbar({ body: t('Please, set the main topic first') })
}
const [width, setWidth] = createSignal(0)
@ -160,7 +155,7 @@ export const HeaderAuth = (props: Props) => {
{renderIconedButton({
value: t('Publish'),
icon: 'publish',
action: handlePublishButtonClick,
action: () => publishShout(form),
})}
</div>