tldr clean up
This commit is contained in:
@@ -13,7 +13,8 @@ export default class Conversation {
|
|||||||
|
|
||||||
cachedAudioClip?: AudioClip; // last message pretty much
|
cachedAudioClip?: AudioClip; // last message pretty much
|
||||||
cachedDrawerItem?: Link; // last link 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();
|
createdDate: Timestamp = Timestamp.now();
|
||||||
createdByUserId: string;
|
createdByUserId: string;
|
||||||
|
|||||||
@@ -27,11 +27,6 @@ export default function ConversationFullRow(props: {
|
|||||||
}) {
|
}) {
|
||||||
const { currUser } = useAuth();
|
const { currUser } = useAuth();
|
||||||
const usersConvosMap = useRecoilValue(allUsersConversationsAtom);
|
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
|
// check if I am outdate on a certain conversation
|
||||||
const isNewIncoming = useRecoilValue(
|
const isNewIncoming = useRecoilValue(
|
||||||
@@ -79,7 +74,7 @@ export default function ConversationFullRow(props: {
|
|||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span className="text-slate-300 w-[20rem] truncate text-sm">
|
<span className="text-slate-300 w-[20rem] truncate text-sm">
|
||||||
{quickUpdateText}
|
{props.conversation.tldr}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span className="ml-auto text-slate-300 text-sm group-hover:invisible">
|
<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 = {
|
const keyMap: KeyMap = {
|
||||||
SELECT_PRIORITY_CONVO: ["1", "2", "3", "4", "5", "6", "7", "8"],
|
SELECT_PRIORITY_CONVO: ["1", "2", "3", "4", "5", "6", "7", "8"],
|
||||||
START_RECORDING: {
|
START_RECORDING: {
|
||||||
@@ -206,12 +225,14 @@ export default function Priority() {
|
|||||||
sequence: "r",
|
sequence: "r",
|
||||||
action: "keyup",
|
action: "keyup",
|
||||||
},
|
},
|
||||||
|
PLAY_LAST_CLIP: "space",
|
||||||
};
|
};
|
||||||
|
|
||||||
const handlers = {
|
const handlers = {
|
||||||
SELECT_PRIORITY_CONVO: selectingPriorityConvoHandler,
|
SELECT_PRIORITY_CONVO: selectingPriorityConvoHandler,
|
||||||
START_RECORDING: startRecording,
|
START_RECORDING: startRecording,
|
||||||
STOP_RECORDING: stopRecording,
|
STOP_RECORDING: stopRecording,
|
||||||
|
PLAY_LAST_CLIP: playLastClip,
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user