diff --git a/gui/src/components/TabBar/TabBar.tsx b/gui/src/components/TabBar/TabBar.tsx index 138676479..6d24853c3 100644 --- a/gui/src/components/TabBar/TabBar.tsx +++ b/gui/src/components/TabBar/TabBar.tsx @@ -1,7 +1,6 @@ import { XMarkIcon } from "@heroicons/react/24/outline"; import React, { useCallback, useEffect } from "react"; import { useDispatch, useSelector } from "react-redux"; -import { useAppSelector } from "../../redux/hooks"; import styled from "styled-components"; import { defaultBorderRadius } from ".."; import { newSession } from "../../redux/slices/sessionSlice"; @@ -15,8 +14,6 @@ import { import { AppDispatch, RootState } from "../../redux/store"; import { loadSession, saveCurrentSession } from "../../redux/thunks/session"; import { varWithFallback } from "../../styles/theme"; -import { useAuth } from "../../context/Auth"; -import { selectSelectedChatModel } from "../../redux/slices/configSlice"; // Haven't set up theme colors for tabs yet // Will keep it simple and choose from existing ones. Comments show vars we could use diff --git a/gui/src/redux/thunks/session.ts b/gui/src/redux/thunks/session.ts index a7e14d237..9dbc5edd4 100644 --- a/gui/src/redux/thunks/session.ts +++ b/gui/src/redux/thunks/session.ts @@ -120,10 +120,7 @@ export const loadSession = createAsyncThunk< dispatch(newSession(session)); // Restore selected chat model from session, if present - const chatModelTitle = (session as any).chatModelTitle as - | string - | null - | undefined; + const chatModelTitle = session.chatModelTitle; if (chatModelTitle) { const state = getState(); const org = state.profiles.organizations.find( @@ -140,7 +137,7 @@ export const loadSession = createAsyncThunk< role: "chat", modelTitle: chatModelTitle, selectedProfile, - }) as any, + }), ); } } @@ -173,10 +170,7 @@ export const loadRemoteSession = createAsyncThunk< dispatch(newSession(session)); // Restore selected chat model from session, if present - const chatModelTitle = (session as any).chatModelTitle as - | string - | null - | undefined; + const chatModelTitle = session.chatModelTitle; if (chatModelTitle) { const state = getState(); const org = state.profiles.organizations.find( @@ -193,7 +187,7 @@ export const loadRemoteSession = createAsyncThunk< role: "chat", modelTitle: chatModelTitle, selectedProfile, - }) as any, + }), ); } } @@ -228,10 +222,7 @@ export const loadLastSession = createAsyncThunk( dispatch(newSession(session)); // Restore selected chat model from session, if present - const chatModelTitle = (session as any).chatModelTitle as - | string - | null - | undefined; + const chatModelTitle = session.chatModelTitle; if (chatModelTitle) { const state = getState(); const org = state.profiles.organizations.find( @@ -248,7 +239,7 @@ export const loadLastSession = createAsyncThunk( role: "chat", modelTitle: chatModelTitle, selectedProfile, - }) as any, + }), ); } } @@ -339,7 +330,7 @@ export const saveCurrentSession = createAsyncThunk< history: state.session.history, mode: state.session.mode, chatModelTitle: selectedChatModel?.title ?? null, - } as Session; + }; const result = await dispatch(updateSession(session)); unwrapResult(result);