lint
Some checks failed
deploy / testbuild (push) Failing after 54s
deploy / Update templates on Mailgun (push) Has been skipped

This commit is contained in:
Untone 2024-10-11 04:55:29 +03:00
parent 6bd219a2e4
commit 7e6ef23bd2
2 changed files with 7 additions and 11 deletions

View File

@ -303,7 +303,6 @@ export const EditorComponent = (props: EditorComponentProps) => {
user: { name: profile.name, color: uniqolor(profile.slug).color }
})
)
} catch (error) {
console.error('Error initializing collaboration:', error)
showSnackbar({ body: t('Failed to initialize collaboration') })
@ -334,13 +333,7 @@ export const EditorComponent = (props: EditorComponentProps) => {
})
// collab mode on/off
createEffect(
on(
isCollabMode,
(x) => !x && initializeCollaboration(),
{ defer: true }
)
)
createEffect(on(isCollabMode, (x) => !x && initializeCollaboration(), { defer: true }))
onCleanup(() => {
editorElRef()?.removeEventListener('focus', handleFocus)

View File

@ -9,8 +9,8 @@ import { MicroBubbleMenu } from './MicroBubbleMenu'
import { ToolbarControl } from './ToolbarControl'
import { Popover } from '~/components/_shared/Popover/Popover'
import styles from './FullBubbleMenu.module.scss'
import { useEditorContext } from '~/context/editor'
import styles from './FullBubbleMenu.module.scss'
type FullBubbleMenuProps = {
editor: () => Editor | undefined
@ -265,8 +265,11 @@ export const FullBubbleMenu = (props: FullBubbleMenuProps) => {
<div class={styles.dropDownHolder}>
<Popover content={t('Collaborative mode')}>
{(triggerRef: (el: HTMLButtonElement) => void) => (
<button ref={triggerRef} type="button" class={styles.actionButton}
onClick={() => setIsCollabMode(x => !x)}
<button
ref={triggerRef}
type="button"
class={styles.actionButton}
onClick={() => setIsCollabMode((x) => !x)}
>
<Icon name={`comment${isCollabMode() ? '-hover' : ''}`} />
</button>