nice scrolling to the latest audio clip
This commit is contained in:
@@ -85,10 +85,6 @@ export default function ViewConvo(props: { conversationId: string }) {
|
|||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
endOfTimeline.current?.scrollIntoView({ behavior: "smooth" });
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
// auth if do not have this conversation in react cache, then we are not authorized
|
// auth if do not have this conversation in react cache, then we are not authorized
|
||||||
// if somehow it's still cached but we were removed,
|
// if somehow it's still cached but we were removed,
|
||||||
// then authenticate by checking if we are in the array of users for the conversation
|
// then authenticate by checking if we are in the array of users for the conversation
|
||||||
@@ -105,6 +101,10 @@ export default function ViewConvo(props: { conversationId: string }) {
|
|||||||
|
|
||||||
const setSelectedConvoId = useSetRecoilState(selectedConvoAtom);
|
const setSelectedConvoId = useSetRecoilState(selectedConvoAtom);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
endOfTimeline.current?.scrollIntoView({ behavior: "smooth" });
|
||||||
|
}, [audioClips]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// should have this convo, otherwise unauthorized
|
// should have this convo, otherwise unauthorized
|
||||||
if (!convo || !convo.activeMembers.includes(currUser!.uid)) {
|
if (!convo || !convo.activeMembers.includes(currUser!.uid)) {
|
||||||
@@ -173,7 +173,7 @@ export default function ViewConvo(props: { conversationId: string }) {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="flex flex-col items-stretch mt-5 space-y-10">
|
<div className="flex flex-col items-stretch mt-5 space-y-10">
|
||||||
{/* main timeline view with action buttons on top */}
|
{/* convo name and action buttons on top */}
|
||||||
<div className="flex-1 flex flex-col overflow-auto">
|
<div className="flex-1 flex flex-col overflow-auto">
|
||||||
{/* header */}
|
{/* header */}
|
||||||
<span className="flex flex-row justify-between items-center mb-5">
|
<span className="flex flex-row justify-between items-center mb-5">
|
||||||
@@ -275,7 +275,10 @@ export default function ViewConvo(props: { conversationId: string }) {
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
{/* have one row, but just translate it along y downward to put it in it's own place */}
|
{/* have one row, but just translate it along y downward to put it in it's own place */}
|
||||||
<span className="flex flex-row flex-nowrap pb-[10rem] py-[5rem] overflow-auto min-h-max">
|
<span
|
||||||
|
className="flex flex-row flex-nowrap pb-[10rem] py-[5rem]
|
||||||
|
overflow-auto min-h-max shadow-xl bg-slate-50 rounded"
|
||||||
|
>
|
||||||
{audioClips.reverse().map((audClip, index) => {
|
{audioClips.reverse().map((audClip, index) => {
|
||||||
const restAudioClips = audioClips.slice(index);
|
const restAudioClips = audioClips.slice(index);
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user