-
+
Syncia
-
+
{
- )
-}
+ );
+};
-export default Header
+export default Header;
diff --git a/src/hooks/useChatHistory.tsx b/src/hooks/useChatHistory.tsx
index 82a9a77d..88a91363 100644
--- a/src/hooks/useChatHistory.tsx
+++ b/src/hooks/useChatHistory.tsx
@@ -31,9 +31,23 @@ export const useChatHistory = () => {
return newId;
};
+ chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => {
+ const tab = tabs[0];
+ if (tab) {
+ console.log(tab);
+ }
+ });
if (currentChatId === initialChatId) {
- createChatHistory("Default Chat");
+ chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => {
+ const tab = tabs[0] as any;
+ if (tab) {
+ const data = JSON.parse(tab.vivExtData);
+ const url = data.urlForThumbnail;
+ const title = new URL(url).hostname;
+ createChatHistory(title);
+ }
+ });
}
const deleteChatHistory = (id: string) => {