remove logs

This commit is contained in:
2024-10-30 19:17:12 +02:00
parent 457608b931
commit 4ce4264dea
13 changed files with 3 additions and 121 deletions

View File

@@ -17,7 +17,6 @@ export const AppViewer = React.forwardRef(({ app , hide}, iframeRef) => {
const { document, window: frameWindow } = useFrame();
const {path, history, changeCurrentIndex} = useQortalMessageListener(frameWindow, iframeRef, app?.tabId)
const [url, setUrl] = useState('')
console.log('historyreact', history)
useEffect(()=> {
setUrl(`${getBaseApiReact()}/render/${app?.service}/${app?.name}${app?.path != null ? `/${app?.path}` : ''}?theme=dark&identifier=${(app?.identifier != null && app?.identifier != 'null') ? app?.identifier : ''}`)
@@ -55,14 +54,12 @@ export const AppViewer = React.forwardRef(({ app , hide}, iframeRef) => {
iframeRef.current.contentWindow.postMessage(
{ action: 'PERFORMING_NON_MANUAL', currentIndex: previousPageIndex }, '*'
);
console.log('previousPageIndex', previousPageIndex)
// Update the current index locally
changeCurrentIndex(previousPageIndex);
// Create a navigation promise with a 200ms timeout
const navigationPromise = new Promise((resolve, reject) => {
function handleNavigationSuccess(event) {
console.log('listeninghandlenav', event)
if (event.data?.action === 'NAVIGATION_SUCCESS' && event.data.path === previousPath) {
frameWindow.removeEventListener('message', handleNavigationSuccess);
resolve();
@@ -86,7 +83,6 @@ export const AppViewer = React.forwardRef(({ app , hide}, iframeRef) => {
// Execute navigation promise and handle timeout fallback
try {
await navigationPromise;
console.log('Navigation succeeded within 200ms.');
} catch (error) {
setUrl(`${getBaseApiReact()}/render/${app?.service}/${app?.name}${previousPath != null ? previousPath : ''}?theme=dark&identifier=${(app?.identifier != null && app?.identifier != 'null') ? app?.identifier : ''}&time=${new Date().getMilliseconds()}&isManualNavigation=false`)
@@ -117,7 +113,6 @@ export const AppViewer = React.forwardRef(({ app , hide}, iframeRef) => {
if (iframeRef.current && iframeRef.current.contentWindow) {
console.log('iframeRef.contentWindow', iframeRef.current.contentWindow);
iframeRef.current.contentWindow.postMessage(
{ action: 'NAVIGATE_FORWARD'},
'*'

View File

@@ -241,68 +241,7 @@ const UIQortalRequests = [
declare var cordova: any;
// try {
// const { filename, mimeType, fileId } = data;
// // Request legacy storage permissions if applicable (for Android 12 and below)
// // await requestLegacyPermissions();
// // Retrieve file from IndexedDB or another source
// const blob = await retrieveFileFromIndexedDB(fileId);
// const buffer = await blob.arrayBuffer();
// return new Promise((resolve, reject) => {
// window.resolveLocalFileSystemURL(
// cordova.file.externalRootDirectory, // Points to the root of public external storage
// (rootDirectoryEntry) => {
// rootDirectoryEntry.getDirectory(
// "Downloads",
// { create: true },
// (downloadsDirectory) => {
// downloadsDirectory.getFile(
// filename,
// { create: true, exclusive: false },
// (fileEntry) => {
// fileEntry.createWriter((fileWriter) => {
// fileWriter.onwriteend = () => {
// console.log("Video saved successfully in public Downloads:", fileEntry.nativeURL);
// resolve(fileEntry.nativeURL);
// };
// fileWriter.onerror = (error) => {
// console.error("Error writing video file:", error);
// reject(error);
// };
// const videoBlob = new Blob([buffer], { type: mimeType || "video/mp4" });
// fileWriter.truncate(0);
// fileWriter.write(videoBlob);
// });
// },
// (error) => {
// console.error("Error accessing or creating file:", error);
// reject(error);
// }
// );
// },
// (error) => {
// console.error("Error accessing Downloads folder:", error);
// reject(error);
// }
// );
// },
// (error) => {
// console.error("Error accessing external storage:", error);
// reject(error);
// }
// );
// });
// } catch (error) {
// console.error("Error saving video file:", error);
// throw error;
// }
// };
async function storeFilesInIndexedDB(obj) {
// First delete any existing files in IndexedDB with '_qortalfile' in their ID
await deleteQortalFilesFromIndexedDB();
@@ -421,9 +360,7 @@ isDOMContentLoaded: false
useEffect(() => {
const listener = async (event) => {
console.log('eventreactt', event)
// event.preventDefault(); // Prevent default behavior
// event.stopImmediatePropagation(); // Stop other listeners from firing
if (event?.data?.requestedHandler !== 'UI') return;

View File

@@ -130,7 +130,6 @@ export const ChatGroup = ({selectedGroup, secretKey, setSecretKey, getSecretKey,
secretKeyObject: secretKey,
})
.then((response) => {
console.log('decryptSingle', response)
if (!response?.error) {
const filterUIMessages = encryptedMessages.filter((item) => !isExtMsg(item.data));
const decodedUIMessages = decodeBase64ForUIChatMessages(filterUIMessages);

View File

@@ -261,12 +261,7 @@ export const GroupMail = ({
async (groupId: string, members: any) => {
try {
setIsLoading(true)
// const memberNames = Object.keys(members);
// const queryString = memberNames
// .map(name => `&name=${encodeURIComponent(name)}`)
// .join("");
// dispatch(setIsLoadingCustom("Loading recent threads"));
const identifier = `thmsg-grp-${groupId}-thread-`;
const url = `${getBaseApiReact()}${getArbitraryEndpointReact()}?mode=ALL&service=${threadIdentifier}&identifier=${identifier}&limit=100&includemetadata=false&offset=${0}&reverse=true&prefix=true`;
const response = await fetch(url, {
@@ -432,19 +427,7 @@ export const GroupMail = ({
}
}, []);
// useEffect(() => {
// if(groupId){
// getGroupMembers(groupId);
// interval.current = setInterval(async () => {
// getGroupMembers(groupId);
// }, 180000)
// }
// return () => {
// if (interval?.current) {
// clearInterval(interval.current)
// }
// }
// }, [getGroupMembers, groupId]);
let listOfThreadsToDisplay = recentThreads;

View File

@@ -203,7 +203,6 @@ export const decryptResource = async (data: string) => {
data,
})
.then((response) => {
console.log('decryptseroucs', response)
if (!response?.error) {
res(response);
return;
@@ -440,7 +439,6 @@ export const Group = ({
const [appsMode, setAppsMode] = useState('home')
const [isOpenSideViewDirects, setIsOpenSideViewDirects] = useState(false)
const [isOpenSideViewGroups, setIsOpenSideViewGroups] = useState(false)
console.log('groups', groups)
const toggleSideViewDirects = ()=> {
if(isOpenSideViewGroups){
setIsOpenSideViewGroups(false)
@@ -896,9 +894,7 @@ export const Group = ({
// Handler function for incoming messages
const messageHandler = (event) => {
const message = event.data;
console.log('SET_GROUPS100', event)
if (message?.action === "SET_GROUPS") {
console.log('SET_GROUPS200', event)
// Update the component state with the received 'sendqort' state
setGroups(message.payload);

View File

@@ -50,7 +50,6 @@ export const WebSocketActive = ({ myAddress, setIsLoadingGroups }) => {
socketRef.current = new WebSocket(socketLink);
socketRef.current.onopen = () => {
console.log('WebSocket connection opened');
setTimeout(pingHeads, 50); // Initial ping
};
@@ -72,7 +71,6 @@ export const WebSocketActive = ({ myAddress, setIsLoadingGroups }) => {
const sortedDirects = (data?.direct || []).filter(item =>
item?.name !== 'extension-proxy' && item?.address !== 'QSMMGSgysEuqDCuLw3S4cHrQkBrh3vP3VH'
).sort((a, b) => (b.timestamp || 0) - (a.timestamp || 0));
console.log('sortedGroups', sortedGroups)
window.sendMessage("handleActiveGroupDataFromSocket", {
groups: sortedGroups,