skyffire il y a 1 an
Parent
commit
031a5258b3
3 fichiers modifiés avec 4 ajouts et 9 suppressions
  1. 1 1
      README.md
  2. 1 6
      example/electron.js
  3. 2 2
      example/public/manifest.json

+ 1 - 1
README.md

@@ -1,4 +1,4 @@
-# @rongmz/react-stock-heatmap
+# react-stock-heatmap
 
 > This is a react chart library for genarating "Stock Heatmap" with given market depth data. Stock Heatmap graph useful for day traders.
 

+ 1 - 6
example/electron.js

@@ -10,7 +10,6 @@ let memoryCache = {};
 
 // Function to decrypt a file and store its content in memory
 function decryptFile(filePath) {
-  // console.log(`Decrypting: ${filePath}`);
   const fileContent = fs.readFileSync(filePath);
   const iv = fileContent.slice(0, 16); // Extract IV
   const encrypted = fileContent.slice(16); // Extract encrypted data
@@ -18,7 +17,6 @@ function decryptFile(filePath) {
   const decrypted = Buffer.concat([decipher.update(encrypted), decipher.final()]);
   const relativePath = path.relative(process.resourcesPath, filePath).replace(/\\/g, '/');
   memoryCache[relativePath] = decrypted;
-  // console.log(`Decrypted: ${filePath}, content: ${decrypted.slice(0, 100)}`);
 }
 
 // Recursively decrypt files in a directory and store their content in memory
@@ -26,7 +24,6 @@ function decryptDirectory(directoryPath) {
   const files = fs.readdirSync(directoryPath);
   files.forEach(file => {
     const fullPath = path.join(directoryPath, file);
-    // console.log(`Processing: ${fullPath}`);
     if (fs.lstatSync(fullPath).isDirectory()) {
       decryptDirectory(fullPath);
     } else {
@@ -37,17 +34,15 @@ function decryptDirectory(directoryPath) {
 
 function createWindow() {
   const directoryToDecrypt = path.join(process.resourcesPath, 'app.asar', 'static');
-  // console.log(`Decrypting directory: ${directoryToDecrypt}`);
   decryptDirectory(directoryToDecrypt);
 
   // Load index.html into memory
   const indexPath = path.join(process.resourcesPath, 'app.asar', 'index.html');
   const indexRelativePath = path.relative(process.resourcesPath, indexPath).replace(/\\/g, '/');
   memoryCache[indexRelativePath] = fs.readFileSync(indexPath);
-  // console.log(`index: ${indexRelativePath}, content: ${memoryCache[indexRelativePath].slice(0, 100)}`);
 
   // Register a custom protocol to serve content from memory
-  protocol.interceptBufferProtocol('file', (request, callback) => {
+  protocol.registerBufferProtocol('file', (request, callback) => {
     const url = request.url.substr(7); // Remove 'file://' prefix
     const relativePath = path.relative(process.resourcesPath, url).replace(/\\/g, '/');
     console.log(`Intercepting request for: ${relativePath}`);

+ 2 - 2
example/public/manifest.json

@@ -1,6 +1,6 @@
 {
-  "short_name": "@rongmz/react-stock-heatmap",
-  "name": "@rongmz/react-stock-heatmap",
+  "short_name": "react-stock-heatmap",
+  "name": "react-stock-heatmap",
   "icons": [
     {
       "src": "favicon.ico",