remove logs

This commit is contained in:
PhilReact 2024-10-25 06:44:34 +03:00
parent 600215fb15
commit b29906af84
6 changed files with 1 additions and 30 deletions

View File

@ -402,9 +402,7 @@ function App() {
}
useEffect(() => {
chrome?.runtime?.sendMessage({ action: "getApiKey" }, (response) => {
console.log('goingggg', response)
if (response) {
console.log('response', response)
handleSetGlobalApikey(response)
setApiKey(response);

View File

@ -33,7 +33,6 @@ export const NotAuthenticated = ({
globalApiKey,
handleSetGlobalApikey,
}) => {
console.log("apiKey", apiKey);
const [isValidApiKey, setIsValidApiKey] = useState<boolean | null>(null);
const [hasLocalNode, setHasLocalNode] = useState<boolean | null>(null);
const [useLocalNode, setUseLocalNode] = useState(false);
@ -57,12 +56,10 @@ export const NotAuthenticated = ({
const isLocal = cleanUrl(currentNode?.url) === "127.0.0.1:12391";
const handleFileChangeApiKey = (event) => {
const file = event.target.files[0]; // Get the selected file
console.log('file', file)
if (file) {
const reader = new FileReader();
reader.onload = (e) => {
const text = e.target.result; // Get the file content
console.log('text', text)
setImportedApiKey(text); // Store the file content in the state
};
@ -95,7 +92,6 @@ export const NotAuthenticated = ({
{ action: "getCustomNodesFromStorage" },
(response) => {
if (response) {
console.log("response", response);
setCustomNodes(response || []);
}
}
@ -109,11 +105,9 @@ export const NotAuthenticated = ({
currentNodeRef.current = currentNode
}, [currentNode])
console.log('currentNode', currentNode)
const validateApiKey = useCallback(async (key) => {
try {
console.log('currentNodeRef.current', currentNodeRef.current, key)
if(!currentNodeRef.current) return
const isLocalKey = cleanUrl(key?.url) === "127.0.0.1:12391";
const isCurrentNodeLocal = cleanUrl(currentNodeRef.current?.url) === "127.0.0.1:12391";
@ -132,7 +126,6 @@ export const NotAuthenticated = ({
} else if(currentNodeRef.current) {
payload = currentNodeRef.current;
}
console.log('payload', payload)
const url = `${payload?.url}/admin/apikey/test`;
const response = await fetch(url, {
method: "GET",
@ -144,12 +137,10 @@ export const NotAuthenticated = ({
// Assuming the response is in plain text and will be 'true' or 'false'
const data = await response.text();
console.log("data", data);
if (data === "true") {
chrome?.runtime?.sendMessage(
{ action: "setApiKey", payload },
(response) => {
console.log("setApiKey", response);
if (response) {
handleSetGlobalApikey(payload);
setIsValidApiKey(true);
@ -189,7 +180,6 @@ export const NotAuthenticated = ({
const saveCustomNodes = (myNodes) => {
let nodes = [...(myNodes || [])];
console.log("customNodeToSaveIndex", customNodeToSaveIndex);
if (customNodeToSaveIndex !== null) {
nodes.splice(customNodeToSaveIndex, 1, {
url,
@ -208,7 +198,6 @@ export const NotAuthenticated = ({
chrome?.runtime?.sendMessage(
{ action: "setCustomNodes", nodes },
(response) => {
console.log("setCustomNodes", response);
if (response) {
setMode("list");
setUrl("http://");
@ -219,7 +208,6 @@ export const NotAuthenticated = ({
);
};
console.log("render customNodes", customNodes, mode);
return (
<>
@ -340,7 +328,6 @@ export const NotAuthenticated = ({
chrome?.runtime?.sendMessage(
{ action: "setApiKey", payload:null },
(response) => {
console.log("setApiKey", response);
if (response) {
setApiKey(null);
handleSetGlobalApikey(null);
@ -519,12 +506,7 @@ export const NotAuthenticated = ({
const nodesToSave = [
...(customNodes || []),
].filter((item) => item?.url !== node?.url);
console.log(
"nodesToSave",
nodesToSave,
customNodes,
node
);
saveCustomNodes(nodesToSave);
}}

View File

@ -41,11 +41,9 @@ export const ChatList = ({ initialMessages, myAddress, tempMessages, chatId, onR
setTimeout(() => {
const hasUnreadMessages = totalMessages.some((msg) => msg.unread && !msg?.chatReference);
console.log('hasUnreadMessages', hasUnreadMessages)
if (parentRef.current) {
const { scrollTop, scrollHeight, clientHeight } = parentRef.current;
const atBottom = scrollTop + clientHeight >= scrollHeight - 10; // Adjust threshold as needed
console.log('atBottom', atBottom, {scrollTop, scrollHeight, clientHeight})
if (!atBottom && hasUnreadMessages) {
setShowScrollButton(hasUnreadMessages);
} else {
@ -60,7 +58,6 @@ export const ChatList = ({ initialMessages, myAddress, tempMessages, chatId, onR
}, [initialMessages, tempMessages]);
const handleMessageSeen = useCallback(() => {
console.log('hello handle seen')
setMessages((prevMessages) =>
prevMessages.map((msg) => ({
...msg,
@ -101,7 +98,6 @@ export const ChatList = ({ initialMessages, myAddress, tempMessages, chatId, onR
return messages[lastIndex]?.signature
}, [messages])
console.log('messages', messages)
// Initialize the virtualizer
const rowVirtualizer = useVirtualizer({
@ -113,7 +109,6 @@ export const ChatList = ({ initialMessages, myAddress, tempMessages, chatId, onR
typeof window !== 'undefined' &&
navigator.userAgent.indexOf('Firefox') === -1
? element => {
console.log('height', element?.getBoundingClientRect().height)
return element?.getBoundingClientRect().height
}
: undefined,

View File

@ -39,12 +39,10 @@ export const MessageItem = ({
useEffect(() => {
if (inView && message.unread) {
console.log('seenlast')
onSeen(message.id);
}
}, [inView, message.id, message.unread, onSeen]);
console.log('isLast', lastSignature === message?.signature)
return (
<div

View File

@ -172,7 +172,6 @@ export const GroupMail = ({
const getAllThreads = React.useCallback(
async (groupId: string, mode: string, isInitial?: boolean) => {
try {
console.log('mode', mode)
setIsLoading(true)
const offset = isInitial ? 0 : allThreads.length;
const isReverse = mode === "Newest" ? true : false;

View File

@ -519,7 +519,6 @@ export const Group = ({
});
} catch (error) {}
};
console.log('desktopViewMode', desktopViewMode)
const getGroupDataSingle = async (groupId) => {
try {
return new Promise((res, rej) => {