fix session resume in new window (#3800)
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { ChatType } from '../types/chat';
|
import { ChatType } from '../types/chat';
|
||||||
import { fetchSessionDetails, generateSessionId } from '../sessions';
|
import { fetchSessionDetails, generateSessionId } from '../sessions';
|
||||||
|
import { ensureClientInitialized } from '../utils';
|
||||||
import { View, ViewOptions } from '../App';
|
import { View, ViewOptions } from '../App';
|
||||||
|
|
||||||
type UseChatArgs = {
|
type UseChatArgs = {
|
||||||
@@ -29,6 +30,7 @@ export const useChat = ({ setIsLoadingSession, setView, setPairChat }: UseChatAr
|
|||||||
|
|
||||||
setIsLoadingSession(true);
|
setIsLoadingSession(true);
|
||||||
try {
|
try {
|
||||||
|
await ensureClientInitialized();
|
||||||
const sessionDetails = await fetchSessionDetails(resumeSessionId);
|
const sessionDetails = await fetchSessionDetails(resumeSessionId);
|
||||||
|
|
||||||
// Only set view if we have valid session details
|
// Only set view if we have valid session details
|
||||||
|
|||||||
Reference in New Issue
Block a user