INNER CODE UNIT · TypeScript

existing

SurgeDM/Surge · extension/entrypoints/popup/store/index.ts:184

      const existing = activeDownloads().find((download) => download.id === message.DownloadID);
      if (existing) {
        upsertActiveDownload({
          ...existing,
          status: 'downloading',
          downloaded: 0,
          progress: 0,
          total_size: message.Total,
          dest_path: message.DestPath,
        });
      } else {
        upsertActiveDownload(createDownload(message, 'downloading', message.Total));
      }
      break;
    }
    case 'complete': {
      const message = data as DownloadCompleteMsg;
      updateActiveDownload(message.DownloadID, (download) => ({

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…