fix(ui): bugfix for rage click

This commit is contained in:
nick-delirium 2023-01-13 16:10:29 +01:00
parent 50b2bd17f4
commit 1b310a28bc
2 changed files with 11 additions and 6 deletions

View file

@ -13,6 +13,7 @@ import { fetchList as fetchMembers } from 'Duck/member';
import PlayerContent from './PlayerContent';
import { IPlayerContext, PlayerContext, defaultContextValue } from './playerContext';
import { observer } from 'mobx-react-lite';
import { Note } from "App/services/NotesService";
const TABS = {
EVENTS: 'User Steps',
@ -36,7 +37,7 @@ function WebPlayer(props: any) {
const { notesStore } = useStore();
const [activeTab, setActiveTab] = useState('');
const [showNoteModal, setShowNote] = useState(false);
const [noteItem, setNoteItem] = useState(null);
const [noteItem, setNoteItem] = useState<Note>();
const [contextValue, setContextValue] = useState<IPlayerContext>(defaultContextValue);
useEffect(() => {
@ -54,10 +55,11 @@ function WebPlayer(props: any) {
if (!isClickmap) {
notesStore.fetchSessionNotes(session.sessionId).then((r) => {
const note = props.query.get('note');
const noteId = props.query.get('note');
const note = notesStore.getNoteById(parseInt(noteId, 10), r)
if (note) {
WebPlayerInst.pause();
setNoteItem(notesStore.getNoteById(parseInt(note, 10), r));
setNoteItem(note);
setShowNote(true);
}
});

View file

@ -87,15 +87,18 @@ class Console extends Event {
}
class Click extends Event {
readonly type = CLICK;
readonly type: typeof CLICKRAGE | typeof CLICK = CLICK;
readonly name = 'Click'
targetContent = '';
count: number
constructor(evt: ClickEvent) {
constructor(evt: ClickEvent, isClickRage: boolean) {
super(evt);
this.targetContent = evt.targetContent
this.count = evt.count
if (isClickRage) {
this.type = CLICKRAGE
}
}
}
@ -151,7 +154,7 @@ export default function(event: EventData) {
return new Location(event as LocationEvent)
}
if (event.type && event.type === CLICKRAGE) {
return new Click(event as ClickEvent)
return new Click(event as ClickEvent, true)
}
// not used right now?
// if (event.type === CUSTOM || !event.type) {