update
This commit is contained in:
parent
98d234b4b3
commit
a7499f9db1
|
|
@ -7,7 +7,7 @@ import { useTranslation } from 'react-i18next';
|
|||
|
||||
|
||||
//TODO: show already invited friends as chips and prevent re-inviting them
|
||||
const JKSessionInviteModal = ({ currentSession, size, show, onToggle, friends, initialInvitees = [], onSubmit, loading }) => {
|
||||
const JKSessionInviteModal = ({ currentSession, show, onToggle, friends, initialInvitees = [], onSubmit, loading }) => {
|
||||
const { t } = useTranslation();
|
||||
const [availableFriends, setAvailableFriends] = useState([]);
|
||||
const [invitees, setInvitees] = useState([]);
|
||||
|
|
@ -45,7 +45,7 @@ const JKSessionInviteModal = ({ currentSession, size, show, onToggle, friends, i
|
|||
};
|
||||
|
||||
return (
|
||||
<Modal isOpen={show} toggle={onToggle} modalClassName="theme-modal" contentClassName="border" size={size || "md"}>
|
||||
<Modal isOpen={show} toggle={onToggle} modalClassName="theme-modal" contentClassName="border">
|
||||
<Form onSubmit={handleSubmit}>
|
||||
<ModalHeader toggle={onToggle} className="bg-light d-flex flex-between-center border-bottom-0">
|
||||
Invite to Session
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import JKSessionPluginModal from './JKSessionPluginModal';
|
|||
import JKSessionPanModal from './JKSessionPanModal';
|
||||
import JKProfileSidePanel from '../profile/JKProfileSidePanel';
|
||||
import { UncontrolledTooltip } from 'reactstrap';
|
||||
import { getInstrumentName, getInstrumentIcon45, convertClientInstrumentToServer } from '../../helpers/utils';
|
||||
import { getInstrumentName } from '../../helpers/utils';
|
||||
import { getPersonById } from '../../helpers/rest';
|
||||
import { ASSIGNMENT } from '../../helpers/globals';
|
||||
import './JKSessionMyTrack.css';
|
||||
|
|
@ -44,7 +44,6 @@ const JKSessionMyTrack = ({
|
|||
const [showPanModal, setShowPanModal] = useState(false);
|
||||
const [showProfilePanel, setShowProfilePanel] = useState(false);
|
||||
const [profileUser, setProfileUser] = useState(null);
|
||||
const [currentInstrumentIcon, setCurrentInstrumentIcon] = useState(instrumentIcon);
|
||||
|
||||
console.log('JKSessionMyTrack instrumentIcon:', instrumentIcon);
|
||||
|
||||
|
|
@ -54,14 +53,6 @@ const JKSessionMyTrack = ({
|
|||
}
|
||||
}, [mixers]);
|
||||
|
||||
useEffect(() => {
|
||||
// Only update local state if the prop has actually changed from our current state
|
||||
// This prevents the server refresh from overwriting our immediate UI update
|
||||
if (currentInstrumentIcon !== instrumentIcon) {
|
||||
setCurrentInstrumentIcon(instrumentIcon);
|
||||
}
|
||||
}, [instrumentIcon, currentInstrumentIcon]);
|
||||
|
||||
const trackClasses = `session-track ${isChat ? 'chat-track' : 'my-track'} ${hasMixer ? 'has-mixer' : 'no-mixer'}`;
|
||||
|
||||
const panStyle = {
|
||||
|
|
@ -124,9 +115,6 @@ const JKSessionMyTrack = ({
|
|||
const handleInstrumentSave = instrumentId => {
|
||||
// For user's own track, use TRACK1
|
||||
jamClient.TrackSetInstrument(ASSIGNMENT.TRACK1, instrumentId);
|
||||
// Immediately update the icon for instant UI feedback
|
||||
const serverInstrumentId = convertClientInstrumentToServer(instrumentId);
|
||||
setCurrentInstrumentIcon(getInstrumentIcon45(serverInstrumentId));
|
||||
setShowInstrumentModal(false);
|
||||
};
|
||||
|
||||
|
|
@ -174,7 +162,7 @@ const JKSessionMyTrack = ({
|
|||
onClick={!isRemote ? handleInstrumentClick : undefined}
|
||||
style={!isRemote ? { cursor: 'pointer' } : {}}
|
||||
>
|
||||
<img height="45" src={currentInstrumentIcon} width="45" alt="instrument" />
|
||||
<img height="45" src={instrumentIcon} width="45" alt="instrument" />
|
||||
{!isRemote && track?.hasVst && (
|
||||
<img
|
||||
src={pluginIcon}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ import volumeIcon from '../../assets/img/client/volume.svg';
|
|||
import videoIcon from '../../assets/img/client/video.svg';
|
||||
import recordIcon from '../../assets/img/client/record.svg';
|
||||
import broadcastIcon from '../../assets/img/client/broadcast.svg';
|
||||
|
||||
import openIcon from '../../assets/img/client/open.svg';
|
||||
import chatIcon from '../../assets/img/client/chat.svg';
|
||||
import attachIcon from '../../assets/img/client/attach.svg';
|
||||
import resyncIcon from '../../assets/img/client/resync.svg';
|
||||
|
|
|
|||
Loading…
Reference in New Issue