Kurzga commited on
Commit
2bf130e
·
1 Parent(s): 871f69c

Fix: Kripto sembol korumasi eklendi ve frontend gereksiz API istekleri (debounce) optimize edildi

Browse files
backend/app/main.py CHANGED
@@ -189,6 +189,15 @@ NON_STOCK_ASSETS = ["TRY=X", "EURTRY=X", "GC=F", "SI=F", "PL=F", "PA=F", "BTC-US
189
  def get_clean_symbol(symbol: str) -> str:
190
  sym = symbol.upper().strip()
191
 
 
 
 
 
 
 
 
 
 
192
  if sym in SUPER_DICTIONARY:
193
  return SUPER_DICTIONARY[sym]
194
 
 
189
  def get_clean_symbol(symbol: str) -> str:
190
  sym = symbol.upper().strip()
191
 
192
+ # Kripto ve popüler emtiaları yakala (.IS eklenmesini engeller)
193
+ KNOWN_GLOBALS = {
194
+ "BTC": "BTC-USD", "ETH": "ETH-USD", "AVAX": "AVAX-USD", "SOL": "SOL-USD",
195
+ "DOGE": "DOGE-USD", "XRP": "XRP-USD", "ADA": "ADA-USD",
196
+ "ALTIN": "GC=F", "ONS": "GC=F", "GUMUS": "SI=F", "BRENT": "BZ=F"
197
+ }
198
+ if sym in KNOWN_GLOBALS:
199
+ return KNOWN_GLOBALS[sym]
200
+
201
  if sym in SUPER_DICTIONARY:
202
  return SUPER_DICTIONARY[sym]
203
 
frontend/dist/assets/index--RrQypRC.js DELETED
The diff for this file is too large to render. See raw diff
 
frontend/dist/index.html CHANGED
@@ -28,7 +28,7 @@
28
  .result { margin-top: 16px; padding: 12px; border-radius: 12px; background: #0b1020; border: 1px dashed #1f2937; }
29
  .footer { text-align:center; color:#64748b; font-size: 12px; padding: 16px 0; }
30
  </style>
31
- <script type="module" crossorigin src="/assets/index--RrQypRC.js"></script>
32
  <link rel="manifest" href="/manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="/registerSW.js"></script></head>
33
  <body>
34
  <div id="root"></div>
 
28
  .result { margin-top: 16px; padding: 12px; border-radius: 12px; background: #0b1020; border: 1px dashed #1f2937; }
29
  .footer { text-align:center; color:#64748b; font-size: 12px; padding: 16px 0; }
30
  </style>
31
+ <script type="module" crossorigin src="/assets/index-Cd7UqYIU.js"></script>
32
  <link rel="manifest" href="/manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="/registerSW.js"></script></head>
33
  <body>
34
  <div id="root"></div>
frontend/dist/sw.js CHANGED
@@ -1 +1 @@
1
- if(!self.define){let e,i={};const n=(n,r)=>(n=new URL(n+".js",r).href,i[n]||new Promise(i=>{if("document"in self){const e=document.createElement("script");e.src=n,e.onload=i,document.head.appendChild(e)}else e=n,importScripts(n),i()}).then(()=>{let e=i[n];if(!e)throw new Error(`Module ${n} didn’t register its module`);return e}));self.define=(r,s)=>{const t=e||("document"in self?document.currentScript.src:"")||location.href;if(i[t])return;let o={};const c=e=>n(e,t),d={module:{uri:t},exports:o,require:c};i[t]=Promise.all(r.map(e=>d[e]||c(e))).then(e=>(s(...e),o))}}define(["./workbox-8c29f6e4"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"index.html",revision:"ccb1405243249133dd9a2ab915fcf443"},{url:"assets/index--RrQypRC.js",revision:null},{url:"icon-192.png",revision:"a26f6edb68d46dc6857446ca4757a405"},{url:"icon-512.png",revision:"3a6a78ae6c05deb1060b586e05461100"},{url:"manifest.webmanifest",revision:"e72689b61c29a71c6ab1479be7cafe31"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))});
 
1
+ if(!self.define){let e,i={};const n=(n,r)=>(n=new URL(n+".js",r).href,i[n]||new Promise(i=>{if("document"in self){const e=document.createElement("script");e.src=n,e.onload=i,document.head.appendChild(e)}else e=n,importScripts(n),i()}).then(()=>{let e=i[n];if(!e)throw new Error(`Module ${n} didn’t register its module`);return e}));self.define=(r,s)=>{const t=e||("document"in self?document.currentScript.src:"")||location.href;if(i[t])return;let o={};const c=e=>n(e,t),l={module:{uri:t},exports:o,require:c};i[t]=Promise.all(r.map(e=>l[e]||c(e))).then(e=>(s(...e),o))}}define(["./workbox-8c29f6e4"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"index.html",revision:"62a22ceeb9596f99fe5c70e0971f279b"},{url:"assets/index-Cd7UqYIU.js",revision:null},{url:"icon-192.png",revision:"a26f6edb68d46dc6857446ca4757a405"},{url:"icon-512.png",revision:"3a6a78ae6c05deb1060b586e05461100"},{url:"manifest.webmanifest",revision:"e72689b61c29a71c6ab1479be7cafe31"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))});
frontend/src/App.tsx CHANGED
@@ -154,6 +154,9 @@ const SymbolIcon = ({ symbol, size = 24 }: { symbol: string; size?: number }) =>
154
  setFetchedSector(null);
155
  if (NON_STOCK_ASSETS.has(mappedSym) || LOCAL_KNOWN.has(cleanSym)) return;
156
 
 
 
 
157
  let cancelled = false;
158
  const fetchSector = async () => {
159
  try {
@@ -166,7 +169,8 @@ const SymbolIcon = ({ symbol, size = 24 }: { symbol: string; size?: number }) =>
166
  }
167
  };
168
 
169
- const timer = setTimeout(fetchSector, 300);
 
170
  return () => { cancelled = true; clearTimeout(timer); };
171
  }, [cleanSym, mappedSym]);
172
 
 
154
  setFetchedSector(null);
155
  if (NON_STOCK_ASSETS.has(mappedSym) || LOCAL_KNOWN.has(cleanSym)) return;
156
 
157
+ // 3 harften kısaysa boşuna backend'i yorma (A, AS, E, EC gibi)
158
+ if (cleanSym.length < 3) return;
159
+
160
  let cancelled = false;
161
  const fetchSector = async () => {
162
  try {
 
169
  }
170
  };
171
 
172
+ // 300ms yerine 800ms bekle. Kullanıcı yazmayı bitirince istek atsın!
173
+ const timer = setTimeout(fetchSector, 800);
174
  return () => { cancelled = true; clearTimeout(timer); };
175
  }, [cleanSym, mappedSym]);
176