tldr clean up
This commit is contained in:
@@ -13,7 +13,8 @@ export default class Conversation {
|
||||
|
||||
cachedAudioClip?: AudioClip; // last message pretty much
|
||||
cachedDrawerItem?: Link; // last link pretty much
|
||||
cachedTldrClip?: string;
|
||||
|
||||
tldr?: string; // description almost that people keep up to day in the convo
|
||||
|
||||
createdDate: Timestamp = Timestamp.now();
|
||||
createdByUserId: string;
|
||||
|
||||
@@ -27,11 +27,6 @@ export default function ConversationFullRow(props: {
|
||||
}) {
|
||||
const { currUser } = useAuth();
|
||||
const usersConvosMap = useRecoilValue(allUsersConversationsAtom);
|
||||
let quickUpdateText = "";
|
||||
|
||||
if (props.conversation.cachedAudioClips?.length > 0) {
|
||||
quickUpdateText = `${props.conversation.cachedAudioClips[0].senderUserId} spoke just now...`;
|
||||
}
|
||||
|
||||
// check if I am outdate on a certain conversation
|
||||
const isNewIncoming = useRecoilValue(
|
||||
@@ -79,7 +74,7 @@ export default function ConversationFullRow(props: {
|
||||
</span>
|
||||
|
||||
<span className="text-slate-300 w-[20rem] truncate text-sm">
|
||||
{quickUpdateText}
|
||||
{props.conversation.tldr}
|
||||
</span>
|
||||
|
||||
<span className="ml-auto text-slate-300 text-sm group-hover:invisible">
|
||||
|
||||
@@ -194,6 +194,25 @@ export default function Priority() {
|
||||
});
|
||||
};
|
||||
|
||||
const playLastClip = () => {
|
||||
if (!selectedConvoId) {
|
||||
toast.error("select a conversation before playing");
|
||||
return;
|
||||
}
|
||||
|
||||
const currConvo = priorityConvos.find(
|
||||
(convo) => convo.id == selectedConvoId
|
||||
);
|
||||
|
||||
if (!currConvo?.cachedAudioClip) {
|
||||
toast.error("nothing to play");
|
||||
return;
|
||||
}
|
||||
|
||||
const audio = new Audio(currConvo?.cachedAudioClip.audioDataUrl);
|
||||
audio.play();
|
||||
};
|
||||
|
||||
const keyMap: KeyMap = {
|
||||
SELECT_PRIORITY_CONVO: ["1", "2", "3", "4", "5", "6", "7", "8"],
|
||||
START_RECORDING: {
|
||||
@@ -206,12 +225,14 @@ export default function Priority() {
|
||||
sequence: "r",
|
||||
action: "keyup",
|
||||
},
|
||||
PLAY_LAST_CLIP: "space",
|
||||
};
|
||||
|
||||
const handlers = {
|
||||
SELECT_PRIORITY_CONVO: selectingPriorityConvoHandler,
|
||||
START_RECORDING: startRecording,
|
||||
STOP_RECORDING: stopRecording,
|
||||
PLAY_LAST_CLIP: playLastClip,
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user