diff --git a/frontend/app/components/Session_/Player/Controls/components/CreateNote.tsx b/frontend/app/components/Session_/Player/Controls/components/CreateNote.tsx index 024bf388c..a6627fec8 100644 --- a/frontend/app/components/Session_/Player/Controls/components/CreateNote.tsx +++ b/frontend/app/components/Session_/Player/Controls/components/CreateNote.tsx @@ -5,20 +5,21 @@ import React from 'react'; import { connect } from 'react-redux'; import { toast } from 'react-toastify'; - - import { useStore } from 'App/mstore'; -import { Note, TAGS, WriteNote, iTag, tagProps } from 'App/services/NotesService'; +import { + Note, + TAGS, + WriteNote, + iTag, + tagProps, +} from 'App/services/NotesService'; import { fetchList as fetchSlack } from 'Duck/integrations/slack'; import { fetchList as fetchTeams } from 'Duck/integrations/teams'; import { addNote, updateNote } from 'Duck/sessions'; import { Button, Checkbox, Icon } from 'UI'; - - import Select from 'Shared/Select'; - interface Props { time: number; addNote: (note: Note) => void; @@ -89,7 +90,9 @@ function CreateNote({ const note: WriteNote = { message: text, tag, - timestamp: useTimestamp ? Math.floor(isEdit && editNote ? editNote.timestamp : time) : -1, + timestamp: useTimestamp + ? Math.floor(isEdit && editNote ? editNote.timestamp : time) + : -1, isPublic, }; const onSuccess = (noteId: string) => { @@ -117,14 +120,12 @@ function CreateNote({ .finally(() => { cleanUp(); }); - } - + } else { return notesStore .addNote(sessionId, note) .then((r) => { onSuccess(r!.noteId as unknown as string); toast.success('Note added'); - void notesStore.fetchSessionNotes(sessionId); }) .catch((e) => { toast.error('Error adding note'); @@ -133,6 +134,7 @@ function CreateNote({ .finally(() => { cleanUp(); }); + } }; const closeTooltip = () => { @@ -159,14 +161,14 @@ function CreateNote({ .toJS() as unknown as { value: string; label: string }[]; slackChannelsOptions.unshift({ - // @ts-ignore + // @ts-ignore value: null, // @ts-ignore label:
Pick a channel
, - disabled: true + disabled: true, }); teamsChannelsOptions.unshift({ - // @ts-ignore + // @ts-ignore value: null, // @ts-ignore label:
Pick a channel
, @@ -184,7 +186,12 @@ function CreateNote({ } }; - const changeTeamsChannel = ({ value }: { value: Record; name: string }) => { + const changeTeamsChannel = ({ + value, + }: { + value: Record; + name: string; + }) => { if (value) { setTeamsChannel(value.value); } @@ -197,7 +204,9 @@ function CreateNote({ >
-

{isEdit ? 'Edit Note' : 'Add Note'}

+

+ {isEdit ? 'Edit Note' : 'Add Note'} +

@@ -222,8 +231,8 @@ function CreateNote({ value={text} autoFocus onChange={(e) => { - setText(e.target.value)} - } + setText(e.target.value); + }} className="text-area" /> @@ -245,13 +254,19 @@ function CreateNote({ ))}
-
setPublic(!isPublic)}> +
setPublic(!isPublic)} + >
Visible to team members
{slackChannelsOptions.length > 1 ? (
-
setSlack(!useSlack)}> +
setSlack(!useSlack)} + > Share via Slack
@@ -273,7 +288,10 @@ function CreateNote({ {teamsChannelsOptions.length > 1 ? (
-
setTeams(!useTeams)}> +
setTeams(!useTeams)} + > Share via MS Teams
@@ -294,8 +312,15 @@ function CreateNote({ ) : null}
-