mirror of
https://github.com/Qortal/qortal-mobile.git
synced 2025-03-14 11:52:33 +00:00
remove logs
This commit is contained in:
parent
457608b931
commit
4ce4264dea
@ -641,9 +641,7 @@ function App() {
|
||||
const qortalRequestPermissonFromExtension = async (message, event) => {
|
||||
if (message.action === "QORTAL_REQUEST_PERMISSION") {
|
||||
try {
|
||||
console.log("QORTAL_REQUEST_PERMISSION2", event, message);
|
||||
await showQortalRequestExtension(message?.payload);
|
||||
console.log("event100", event);
|
||||
if (qortalRequestCheckbox1Ref.current) {
|
||||
event.source.postMessage(
|
||||
{
|
||||
@ -686,7 +684,6 @@ function App() {
|
||||
useEffect(() => {
|
||||
// Handler function for incoming messages
|
||||
const messageHandler = (event) => {
|
||||
console.log("messageHandler", event);
|
||||
const message = event.data;
|
||||
|
||||
if (message?.action === "CHECK_FOCUS") {
|
||||
@ -761,7 +758,6 @@ function App() {
|
||||
window
|
||||
.sendMessage("getWalletInfo")
|
||||
.then((response) => {
|
||||
console.log("getwalll", response);
|
||||
if (response && response?.walletInfo) {
|
||||
setRawWallet(response?.walletInfo);
|
||||
if (
|
||||
@ -1022,7 +1018,6 @@ function App() {
|
||||
wallet: rawWallet,
|
||||
})
|
||||
.then((response) => {
|
||||
console.log("response2", response);
|
||||
if (response && !response.error) {
|
||||
setAuthenticatePassword("");
|
||||
setExtstate("authenticated");
|
||||
|
@ -200,11 +200,8 @@ export async function userInfoCase(request, event) {
|
||||
|
||||
export async function decryptWalletCase(request, event) {
|
||||
try {
|
||||
console.log('request', request)
|
||||
const { password, wallet } = request.payload;
|
||||
console.log({password, wallet})
|
||||
const response = await decryptWallet({password, wallet, walletVersion});
|
||||
console.log('response', response)
|
||||
event.source.postMessage(
|
||||
{
|
||||
requestId: request.requestId,
|
||||
@ -1368,9 +1365,7 @@ export async function publishGroupEncryptedResourceCase(request, event) {
|
||||
export async function decryptGroupEncryptionCase(request, event) {
|
||||
try {
|
||||
const { data} = request.payload;
|
||||
console.log('data', data)
|
||||
const response = await decryptGroupEncryption({ data });
|
||||
console.log('dataresponse', response)
|
||||
event.source.postMessage(
|
||||
{
|
||||
requestId: request.requestId,
|
||||
@ -1423,9 +1418,7 @@ export async function publishGroupEncryptedResourceCase(request, event) {
|
||||
export async function decryptSingleCase(request, event) {
|
||||
try {
|
||||
const { data, secretKeyObject, skipDecodeBase64} = request.payload;
|
||||
console.log({data, secretKeyObject, skipDecodeBase64})
|
||||
const response = await decryptSingleFunc({ messages: data, secretKeyObject, skipDecodeBase64 });
|
||||
console.log('response', response)
|
||||
event.source.postMessage(
|
||||
{
|
||||
requestId: request.requestId,
|
||||
|
@ -1560,7 +1560,6 @@ const getStoredData = async (key) => {
|
||||
|
||||
export async function handleActiveGroupDataFromSocket({ groups, directs }) {
|
||||
try {
|
||||
console.log('handleActiveGroupDataFromSocket3', groups, directs)
|
||||
window.postMessage({
|
||||
action: "SET_GROUPS",
|
||||
payload: groups,
|
||||
@ -2887,7 +2886,6 @@ function setupMessageListener() {
|
||||
// Check if the message is intended for this listener
|
||||
if (request?.type !== "backgroundMessage") return; // Only process messages of type 'backgroundMessage'
|
||||
|
||||
console.log("REQUEST MESSAGE", request);
|
||||
|
||||
switch (request.action) {
|
||||
case "version":
|
||||
@ -2913,7 +2911,6 @@ function setupMessageListener() {
|
||||
userInfoCase(request, event);
|
||||
break;
|
||||
case "decryptWallet":
|
||||
console.log('going through')
|
||||
decryptWalletCase(request, event);
|
||||
break;
|
||||
case "balance":
|
||||
|
@ -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'},
|
||||
'*'
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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,
|
||||
|
@ -330,7 +330,6 @@ export const decodeBase64ForUIChatMessages = (messages)=> {
|
||||
|
||||
|
||||
export function decryptGroupData(data64EncryptedData: string, privateKey: string) {
|
||||
console.log({data64EncryptedData, privateKey})
|
||||
const allCombined = base64ToUint8Array(data64EncryptedData)
|
||||
const str = "qortalGroupEncryptedData"
|
||||
const strEncoder = new TextEncoder()
|
||||
|
@ -30,7 +30,6 @@ function setLocalStorage(key, data) {
|
||||
// Save the updated object back to storage
|
||||
await setLocalStorage('qortalRequestPermissions', qortalRequestPermissions );
|
||||
|
||||
console.log('Permission set for', key);
|
||||
} catch (error) {
|
||||
console.error('Error setting permission:', error);
|
||||
}
|
||||
@ -61,7 +60,6 @@ function setLocalStorage(key, data) {
|
||||
const isFromExtension = request?.isExtension;
|
||||
if (request?.type !== "backgroundMessage") return; // Only process messages of type 'backgroundMessage'
|
||||
|
||||
console.log("REQUEST MESSAGE QORTALREQUEST", request);
|
||||
|
||||
// Handle actions based on the `request.action` value
|
||||
switch (request.action) {
|
||||
@ -87,7 +85,6 @@ function setLocalStorage(key, data) {
|
||||
|
||||
case "ENCRYPT_DATA": {
|
||||
try {
|
||||
console.log('ENCRYPTDATA', request)
|
||||
const res = await encryptData(request.payload, event.source);
|
||||
event.source.postMessage({
|
||||
requestId: request.requestId,
|
||||
@ -369,7 +366,6 @@ function setLocalStorage(key, data) {
|
||||
case "GET_WALLET_BALANCE": {
|
||||
try {
|
||||
const res = await getWalletBalance(request.payload, false, isFromExtension);
|
||||
console.log('ressss', res)
|
||||
event.source.postMessage({
|
||||
requestId: request.requestId,
|
||||
action: request.action,
|
||||
|
@ -201,20 +201,16 @@ const handleFileMessage = (event) => {
|
||||
window.addEventListener("message", handleFileMessage);
|
||||
|
||||
function getFileFromContentScript(fileId) {
|
||||
console.log('handleGetFileFromIndexedDB', fileId)
|
||||
return new Promise((resolve, reject) => {
|
||||
const requestId = `getFile_${fileId}_${Date.now()}`;
|
||||
console.log('handleGetFileFromIndexedDB', requestId)
|
||||
|
||||
fileRequestResolvers.set(requestId, { resolve, reject }); // Store resolvers by requestId
|
||||
console.log('handleGetFileFromIndexedDB', 'passed')
|
||||
|
||||
// Send the request message
|
||||
window.postMessage(
|
||||
{ action: "getFileFromIndexedDB", fileId, requestId },
|
||||
"*"
|
||||
);
|
||||
console.log('handleGetFileFromIndexedDB', 'after', window.origin)
|
||||
|
||||
// Timeout to handle no response scenario
|
||||
setTimeout(() => {
|
||||
@ -239,7 +235,6 @@ const responseResolvers = new Map();
|
||||
|
||||
const handleMessage = (event) => {
|
||||
const { action, requestId, result } = event.data;
|
||||
console.log("Received message:", event);
|
||||
|
||||
// Check if this is the expected response action and if we have a stored resolver
|
||||
if (action === "QORTAL_REQUEST_PERMISSION_RESPONSE" && responseResolvers.has(requestId)) {
|
||||
|
@ -6,7 +6,6 @@ function fetchFromLocalStorage(key) {
|
||||
try {
|
||||
const serializedValue = localStorage.getItem(key);
|
||||
if (serializedValue === null) {
|
||||
console.log(`No data found for key: ${key}`);
|
||||
return null;
|
||||
}
|
||||
return JSON.parse(serializedValue);
|
||||
|
Loading…
x
Reference in New Issue
Block a user