selecting lines over and over again
This commit is contained in:
@@ -277,21 +277,23 @@ export function RealTimeRoomProvider({ children }: { children: React.ReactChild
|
|||||||
*/
|
*/
|
||||||
const handleSelectLine = useCallback(
|
const handleSelectLine = useCallback(
|
||||||
(newLineIdToSelect: string) => {
|
(newLineIdToSelect: string) => {
|
||||||
toast('selecting line!! NOT IMPLEMENTED');
|
|
||||||
|
|
||||||
setSelectedLineId((prevLineId) => {
|
setSelectedLineId((prevLineId) => {
|
||||||
|
if (newLineIdToSelect === prevLineId) {
|
||||||
|
return prevLineId;
|
||||||
|
}
|
||||||
|
|
||||||
// untune from the last line if it was just a temporary tuned one
|
// untune from the last line if it was just a temporary tuned one
|
||||||
if (roomMap[prevLineId]?.currentUserMember.state === LineMemberState.INBOX) {
|
if (roomMap[prevLineId]?.currentUserMember.state === LineMemberState.INBOX) {
|
||||||
handleUntuneFromLine(prevLineId);
|
handleUntuneFromLine(prevLineId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// tune in if not already tuned into this line
|
||||||
|
if (!roomMap[newLineIdToSelect].tunedInMemberIds?.includes(user._id.toString())) {
|
||||||
|
handleTuneIntoLine(newLineIdToSelect);
|
||||||
|
}
|
||||||
|
|
||||||
return newLineIdToSelect;
|
return newLineIdToSelect;
|
||||||
});
|
});
|
||||||
|
|
||||||
// tune in if not already tuned into this line
|
|
||||||
if (!roomMap[newLineIdToSelect].tunedInMemberIds?.includes(user._id.toString())) {
|
|
||||||
handleTuneIntoLine(newLineIdToSelect);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
[setSelectedLineId, handleUntuneFromLine, roomMap, user, handleTuneIntoLine],
|
[setSelectedLineId, handleUntuneFromLine, roomMap, user, handleTuneIntoLine],
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -100,58 +100,57 @@ export default function NavBar() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<div
|
||||||
|
className="flex flex-row items-center bg-gray-100 p-4 border-b border-b-gray-200"
|
||||||
|
id="titlebar"
|
||||||
|
>
|
||||||
<div
|
<div
|
||||||
className="flex flex-row items-center bg-gray-100 p-4 border-b border-b-gray-200"
|
onKeyDown={handleOpenMainApp}
|
||||||
id="titlebar"
|
onClick={() => {
|
||||||
|
console.log('opening main app');
|
||||||
|
}}
|
||||||
|
role="presentation"
|
||||||
>
|
>
|
||||||
<div
|
<NoTextLogo type="small" />
|
||||||
onKeyDown={handleOpenMainApp}
|
</div>
|
||||||
onClick={() => {
|
|
||||||
console.log('opening main app');
|
{!shouldHideSearch && (
|
||||||
}}
|
<div className="mx-auto flex flex-row items-center space-x-2">
|
||||||
role="presentation"
|
<FaSearch className="text-xs text-gray-300" />
|
||||||
>
|
<input
|
||||||
<NoTextLogo type="small" />
|
placeholder="Type / to search"
|
||||||
|
className="bg-transparent placeholder-gray-300 placeholder:text-xs focus:outline-none"
|
||||||
|
ref={inputRef}
|
||||||
|
onChange={onSearchChange}
|
||||||
|
value={searchInput}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
{!shouldHideSearch && (
|
<button
|
||||||
<div className="mx-auto flex flex-row items-center space-x-2">
|
onClick={handleFlowState}
|
||||||
<FaSearch className="text-xs text-gray-300" />
|
className="text-gray-300 text-xs p-3 transition-all hover:bg-gray-200"
|
||||||
<input
|
>
|
||||||
placeholder="Type / to search"
|
flow state
|
||||||
className="bg-transparent placeholder-gray-300 placeholder:text-xs focus:outline-none"
|
</button>
|
||||||
ref={inputRef}
|
|
||||||
onChange={onSearchChange}
|
<Dropdown overlay={profileMenu}>
|
||||||
value={searchInput}
|
<div className={'cursor-pointer ml-2'}>
|
||||||
|
{user.picture && (
|
||||||
|
<Avatar
|
||||||
|
key={`userHeaderProfilePicture`}
|
||||||
|
className="shadow-md hover:scale-110 transition-all"
|
||||||
|
size={'large'}
|
||||||
|
alt={user.name}
|
||||||
|
src={user.picture}
|
||||||
|
shape="square"
|
||||||
/>
|
/>
|
||||||
</div>
|
)}
|
||||||
)}
|
</div>
|
||||||
|
</Dropdown>
|
||||||
|
|
||||||
<button
|
{/* menu for the output options */}
|
||||||
onClick={handleFlowState}
|
{/* <Menu
|
||||||
className="text-gray-300 text-xs p-3 transition-all hover:bg-gray-200"
|
|
||||||
>
|
|
||||||
flow state
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<Dropdown overlay={profileMenu}>
|
|
||||||
<div className={'cursor-pointer ml-2'}>
|
|
||||||
{user.picture && (
|
|
||||||
<Avatar
|
|
||||||
key={`userHeaderProfilePicture`}
|
|
||||||
className="shadow-md hover:scale-110 transition-all"
|
|
||||||
size={'large'}
|
|
||||||
alt={user.name}
|
|
||||||
src={user.picture}
|
|
||||||
shape="square"
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</Dropdown>
|
|
||||||
|
|
||||||
{/* menu for the output options */}
|
|
||||||
{/* <Menu
|
|
||||||
open={menuOpen}
|
open={menuOpen}
|
||||||
id="user-output-selection-menu"
|
id="user-output-selection-menu"
|
||||||
anchorEl={anchorEl}
|
anchorEl={anchorEl}
|
||||||
@@ -174,7 +173,6 @@ export default function NavBar() {
|
|||||||
<ListItemText>Video</ListItemText>
|
<ListItemText>Video</ListItemText>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
</Menu> */}
|
</Menu> */}
|
||||||
</div>
|
</div>
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user