Skip to content

Commit e6353ff

Browse files
authored
Merge pull request #101 from omgate234/feat/meeting-recorder
Feat/meeting recorder
2 parents c28fa52 + a07b65c commit e6353ff

File tree

3 files changed

+58
-5
lines changed

3 files changed

+58
-5
lines changed

src/components/chat/ChatInterface.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@
334334
<ShareModal
335335
:show-dialog="showShareModal"
336336
:session-id="sessionToShare?.session_id"
337+
:is-public="sessionToShare?.is_public"
337338
:on-make-public="makeSessionPublic"
338339
@close="showShareModal = false"
339340
/>

src/components/hooks/useVideoDBAgent.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,14 @@ export function useVideoDBAgent(config) {
208208
res.status = "success";
209209
res.success = true;
210210
res.data = data;
211+
212+
const idx = sessions.value.findIndex((s) => s.session_id === sessionId);
213+
if (idx !== -1) {
214+
sessions.value[idx] = {
215+
...sessions.value[idx],
216+
is_public: isPublic,
217+
};
218+
}
211219
} catch (error) {
212220
res.status = "error";
213221
res.success = false;

src/components/modals/ShareModal.vue

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
</div>
2525

2626
<!-- Description -->
27-
<p class="vdb-c-mb-16 vdb-c-text-sm vdb-c-text-gray-600">
28-
A public link to your chat has been created. Manage previously shared
29-
chats at any time via Settings.
27+
<p class="vdb-c-mb-16 vdb-c-text-sm vdb-c-text-black">
28+
Share the link with everyone to show all the cool things you made
29+
{{ ":)" }}
3030
</p>
3131

3232
<!-- Loading State -->
@@ -51,7 +51,7 @@
5151
<input
5252
:value="publicLink"
5353
readonly
54-
class="vdb-c-flex-1 vdb-c-border-none vdb-c-bg-transparent vdb-c-text-sm vdb-c-text-gray-800 vdb-c-outline-none"
54+
class="vdb-c-flex-1 vdb-c-border-none vdb-c-bg-transparent vdb-c-text-sm vdb-c-text-black vdb-c-outline-none"
5555
/>
5656
<button
5757
@click="copyLink"
@@ -149,6 +149,10 @@ const props = defineProps({
149149
type: String,
150150
default: "",
151151
},
152+
isPublic: {
153+
type: Boolean,
154+
default: false,
155+
},
152156
onMakePublic: {
153157
type: Function,
154158
required: true,
@@ -184,7 +188,7 @@ const copyLink = async () => {
184188
};
185189
186190
const shareOnLinkedIn = () => {
187-
const url = `https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(publicLink.value)}`;
191+
const url = `https://www.linkedin.com/feed/?shareActive=true&text=${encodeURIComponent("Check out this chat session from VideoDB Director! \n" + publicLink.value)}`;
188192
window.open(url, "_blank");
189193
};
190194
@@ -198,11 +202,41 @@ const shareOnX = () => {
198202
window.open(url, "_blank");
199203
};
200204
205+
const initializeShare = async (sid) => {
206+
if (!sid || !props.showDialog) return;
207+
if (props.isPublic) {
208+
publicLink.value = `${window.location.origin}/share/${sid}`;
209+
isLoading.value = false;
210+
error.value = "";
211+
return;
212+
}
213+
isLoading.value = true;
214+
error.value = "";
215+
publicLink.value = "";
216+
try {
217+
const result = await props.onMakePublic(sid);
218+
if (result.success) {
219+
publicLink.value = `${window.location.origin}/share/${sid}`;
220+
} else {
221+
error.value = result.error || "Failed to create public link";
222+
}
223+
} catch (err) {
224+
error.value = "Failed to create public link";
225+
console.error("Error making session public:", err);
226+
} finally {
227+
isLoading.value = false;
228+
}
229+
};
230+
201231
// Watch for sessionId changes and make session public
202232
watch(
203233
() => props.sessionId,
204234
async (newSessionId) => {
205235
if (newSessionId && props.showDialog) {
236+
if (props.isPublic) {
237+
publicLink.value = `${window.location.origin}/share/${newSessionId}`;
238+
return;
239+
}
206240
isLoading.value = true;
207241
error.value = "";
208242
publicLink.value = "";
@@ -224,6 +258,16 @@ watch(
224258
},
225259
{ immediate: true },
226260
);
261+
262+
// Re-run initialization whenever the modal is opened
263+
watch(
264+
() => props.showDialog,
265+
async (isOpen) => {
266+
if (isOpen) {
267+
await initializeShare(props.sessionId);
268+
}
269+
},
270+
);
227271
</script>
228272

229273
<style scoped>

0 commit comments

Comments
 (0)