mirror of
https://github.com/Qortal/Qortal-Hub.git
synced 2025-04-23 11:27:52 +00:00
remove un-needed code
This commit is contained in:
parent
c9807921e9
commit
ef058b9c8b
@ -6,8 +6,7 @@ import {
|
|||||||
useRef,
|
useRef,
|
||||||
useState,
|
useState,
|
||||||
} from "react";
|
} from "react";
|
||||||
import reactLogo from "./assets/react.svg";
|
|
||||||
import viteLogo from "/vite.svg";
|
|
||||||
import "./App.css";
|
import "./App.css";
|
||||||
import { useDropzone } from "react-dropzone";
|
import { useDropzone } from "react-dropzone";
|
||||||
import {
|
import {
|
||||||
@ -149,7 +148,7 @@ const defaultValues: MyContextInterface = {
|
|||||||
message: "",
|
message: "",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
export let isMobile = false;
|
export let isMobile = true;
|
||||||
|
|
||||||
const isMobileDevice = () => {
|
const isMobileDevice = () => {
|
||||||
const userAgent = navigator.userAgent || navigator.vendor || window.opera;
|
const userAgent = navigator.userAgent || navigator.vendor || window.opera;
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
// import { encryptAndPublishSymmetricKeyGroupChat } from "./backgroundFunctions/encryption";
|
|
||||||
|
|
||||||
import './qortalRequests'
|
import './qortalRequests'
|
||||||
import { constant, isArray } from "lodash";
|
import { isArray } from "lodash";
|
||||||
import {
|
import {
|
||||||
decryptGroupEncryption,
|
decryptGroupEncryption,
|
||||||
encryptAndPublishSymmetricKeyGroupChat,
|
encryptAndPublishSymmetricKeyGroupChat,
|
||||||
@ -11,7 +10,6 @@ import {
|
|||||||
uint8ArrayToObject,
|
uint8ArrayToObject,
|
||||||
} from "./backgroundFunctions/encryption";
|
} from "./backgroundFunctions/encryption";
|
||||||
import { PUBLIC_NOTIFICATION_CODE_FIRST_SECRET_KEY } from "./constants/codes";
|
import { PUBLIC_NOTIFICATION_CODE_FIRST_SECRET_KEY } from "./constants/codes";
|
||||||
import { QORT_DECIMALS } from "./constants/constants";
|
|
||||||
import Base58 from "./deps/Base58";
|
import Base58 from "./deps/Base58";
|
||||||
import {
|
import {
|
||||||
base64ToUint8Array,
|
base64ToUint8Array,
|
||||||
@ -51,7 +49,7 @@ export const groupApiLocal = "http://127.0.0.1:12391";
|
|||||||
export const groupApiSocketLocal = "ws://127.0.0.1:12391";
|
export const groupApiSocketLocal = "ws://127.0.0.1:12391";
|
||||||
const timeDifferenceForNotificationChatsBackground = 600000;
|
const timeDifferenceForNotificationChatsBackground = 600000;
|
||||||
const requestQueueAnnouncements = new RequestQueueWithPromise(1);
|
const requestQueueAnnouncements = new RequestQueueWithPromise(1);
|
||||||
let isMobile = false;
|
let isMobile = true;
|
||||||
|
|
||||||
|
|
||||||
const isMobileDevice = () => {
|
const isMobileDevice = () => {
|
||||||
@ -131,14 +129,7 @@ const getCustomNodesFromStorage = async () => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// const getArbitraryEndpoint = ()=> {
|
|
||||||
// const apiKey = await getApiKeyFromStorage(); // Retrieve apiKey asynchronously
|
|
||||||
// if (apiKey) {
|
|
||||||
// return `/arbitrary/resources/search`;
|
|
||||||
// } else {
|
|
||||||
// return `/arbitrary/resources/searchsimple`;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
const getArbitraryEndpoint = async () => {
|
const getArbitraryEndpoint = async () => {
|
||||||
const apiKey = await getApiKeyFromStorage(); // Retrieve apiKey asynchronously
|
const apiKey = await getApiKeyFromStorage(); // Retrieve apiKey asynchronously
|
||||||
if (apiKey) {
|
if (apiKey) {
|
||||||
@ -2519,17 +2510,6 @@ async function listenForChatMessageForBuyOrder({
|
|||||||
senderPublicKey
|
senderPublicKey
|
||||||
);
|
);
|
||||||
|
|
||||||
// const resKeyPair = await getKeyPair()
|
|
||||||
// const parsedData = JSON.parse(resKeyPair)
|
|
||||||
// const uint8PrivateKey = Base58.decode(parsedData.privateKey);
|
|
||||||
// const uint8PublicKey = Base58.decode(parsedData.publicKey);
|
|
||||||
// const keyPair = {
|
|
||||||
// privateKey: uint8PrivateKey,
|
|
||||||
// publicKey: uint8PublicKey
|
|
||||||
// };
|
|
||||||
|
|
||||||
// const decodedMessage = decryptChatMessage(encodedMessageObj.data, keyPair.privateKey, senderPublicKey, encodedMessageObj.reference)
|
|
||||||
// const parsedMessage = JSON.parse(decodedMessage)
|
|
||||||
chrome.tabs.query({}, function (tabs) {
|
chrome.tabs.query({}, function (tabs) {
|
||||||
tabs.forEach((tab) => {
|
tabs.forEach((tab) => {
|
||||||
chrome.tabs.sendMessage(tab.id, {
|
chrome.tabs.sendMessage(tab.id, {
|
||||||
@ -3852,9 +3832,6 @@ chrome?.runtime?.onMessage.addListener((request, sender, sendResponse) => {
|
|||||||
originalSendResponse(res);
|
originalSendResponse(res);
|
||||||
// Remove the callback from the Map as it's no longer needed
|
// Remove the callback from the Map as it's no longer needed
|
||||||
pendingResponses.delete(interactionId2);
|
pendingResponses.delete(interactionId2);
|
||||||
// chrome.runtime.sendMessage({
|
|
||||||
// action: "closePopup",
|
|
||||||
// });
|
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error(error.message);
|
console.error(error.message);
|
||||||
@ -4175,30 +4152,6 @@ chrome?.runtime?.onMessage.addListener((request, sender, sendResponse) => {
|
|||||||
case "setupGroupWebsocket": {
|
case "setupGroupWebsocket": {
|
||||||
checkNewMessages();
|
checkNewMessages();
|
||||||
checkThreads();
|
checkThreads();
|
||||||
|
|
||||||
// if(socket){
|
|
||||||
// if(groups){
|
|
||||||
// console.log('hasgroups1')
|
|
||||||
// chrome.runtime.sendMessage({
|
|
||||||
// action: "SET_GROUPS",
|
|
||||||
// payload: groups,
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// if(directs){
|
|
||||||
// console.log('hasgroups1')
|
|
||||||
// chrome.runtime.sendMessage({
|
|
||||||
// action: "SET_DIRECTS",
|
|
||||||
// payload: directs,
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// sendResponse(true)
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
// setTimeout(() => {
|
|
||||||
// // initWebsocketMessageGroup()
|
|
||||||
// listenForNewGroupAnnouncements()
|
|
||||||
// listenForThreadUpdates()
|
|
||||||
// }, 200);
|
|
||||||
sendResponse(true);
|
sendResponse(true);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -4559,9 +4512,6 @@ chrome.notifications?.onClicked?.addListener((notificationId) => {
|
|||||||
// Reconnect when service worker wakes up
|
// Reconnect when service worker wakes up
|
||||||
chrome.runtime?.onStartup.addListener(() => {
|
chrome.runtime?.onStartup.addListener(() => {
|
||||||
console.log("Service worker started up, reconnecting WebSocket...");
|
console.log("Service worker started up, reconnecting WebSocket...");
|
||||||
// initWebsocketMessageGroup();
|
|
||||||
// listenForNewGroupAnnouncements()
|
|
||||||
// listenForThreadUpdates()
|
|
||||||
});
|
});
|
||||||
|
|
||||||
chrome.runtime?.onInstalled.addListener((details) => {
|
chrome.runtime?.onInstalled.addListener((details) => {
|
||||||
@ -4579,10 +4529,7 @@ chrome.runtime?.onInstalled.addListener((details) => {
|
|||||||
// Optional: Handle Chrome-specific updates if necessary
|
// Optional: Handle Chrome-specific updates if necessary
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize WebSocket and other required listeners
|
|
||||||
// initWebsocketMessageGroup();
|
|
||||||
// listenForNewGroupAnnouncements();
|
|
||||||
// listenForThreadUpdates();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Check if the alarm already exists before creating it
|
// Check if the alarm already exists before creating it
|
||||||
@ -4596,7 +4543,6 @@ chrome.alarms?.get("checkForNotifications", (existingAlarm) => {
|
|||||||
chrome.alarms?.onAlarm.addListener(async (alarm) => {
|
chrome.alarms?.onAlarm.addListener(async (alarm) => {
|
||||||
try {
|
try {
|
||||||
if (alarm.name === "checkForNotifications") {
|
if (alarm.name === "checkForNotifications") {
|
||||||
// initWebsocketMessageGroup(address);
|
|
||||||
const wallet = await getSaveWallet();
|
const wallet = await getSaveWallet();
|
||||||
const address = wallet.address0;
|
const address = wallet.address0;
|
||||||
if (!address) return;
|
if (!address) return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user