mirror of
https://github.com/christianvidalwolf-prog/Craze-Data-check.git
synced 2026-08-03 14:05:25 +02:00
fix(dropbox): use direct raw fallback
This commit is contained in:
+7
-9
@@ -56,6 +56,8 @@ const FORCED_ZERO_STOCK_SKUS = new Set([
|
||||
|
||||
const BC_SYNC_QUEUE_STORAGE_KEY = 'craze_bc_sync_queue';
|
||||
const LEGACY_CPNP_INDEX = 77;
|
||||
const DROPBOX_PROXY_URL = '/api/dropbox-proxy';
|
||||
const DROPBOX_FILE_URL = '/dropbox-file/scl/fi/usa8me7ywgylrij2bt6hj/Data-Matrix.xlsx?rlkey=tsec8csrhye54u1fdvk15ped1&st=qbxxs4cn&dl=0';
|
||||
|
||||
type BcSyncStatus = 'queued' | 'previewed' | 'preview_only' | 'syncing' | 'synced' | 'failed';
|
||||
|
||||
@@ -216,19 +218,15 @@ export default function App() {
|
||||
return arrayBuffer.byteLength;
|
||||
};
|
||||
|
||||
const dropboxSources = import.meta.env.DEV
|
||||
? [
|
||||
'/api/dropbox-proxy',
|
||||
`/dropbox-file/scl/fi/usa8me7ywgylrij2bt6hj/Data-Matrix.xlsx?rlkey=tsec8csrhye54u1fdvk15ped1&st=qbxxs4cn&dl=0&t=${Date.now()}`
|
||||
]
|
||||
: [
|
||||
'/api/dropbox-proxy'
|
||||
];
|
||||
const dropboxSources = [
|
||||
DROPBOX_PROXY_URL,
|
||||
`${DROPBOX_FILE_URL}&t=${Date.now()}`
|
||||
];
|
||||
|
||||
let lastError: unknown = null;
|
||||
for (const source of dropboxSources) {
|
||||
try {
|
||||
console.log(`Fetching Data-Matrix.xlsx from ${source.includes('/api/') ? 'proxy' : 'Dropbox'}...`);
|
||||
console.log(`Fetching Data-Matrix.xlsx from ${source}...`);
|
||||
const size = await loadWorkbookFromUrl(source);
|
||||
fileMeta = { rev: source, size };
|
||||
lastError = null;
|
||||
|
||||
Reference in New Issue
Block a user