progress.ts 485 B

12345678910111213141516
  1. export function updateFileProgress(file: string, progress: number) {
  2. if (typeof window !== "undefined") {
  3. if(! (<any>window).chatvrm_loading_progress) {
  4. (<any>window).chatvrm_loading_progress = {};
  5. (<any>window).chatvrm_loading_progress_cnt = 0;
  6. }
  7. }
  8. if (progress === 100) {
  9. delete (<any>window).chatvrm_loading_progress[file];
  10. } else {
  11. (<any>window).chatvrm_loading_progress[file] = progress;
  12. }
  13. (<any>window).chatvrm_loading_progress_cnt++;
  14. }