reduce maps loading by 40% from micro optimization

This commit is contained in:
MathieuG-P
2023-03-01 00:52:42 +01:00
parent 5641c25cc1
commit 363cc3cc5e
9 changed files with 35 additions and 35 deletions
@@ -51,7 +51,6 @@ export function FilterPanel({className, ref, playlist = false, filter, onChange,
firstRun.current = false;
return;
}
console.log(filter, firstFilter);
setHaveChanged(() => !equal(filter, firstFilter));
}, [filter])
@@ -117,7 +117,6 @@ export const LocalMapsListPanel = forwardRef(({version, className, filter, searc
const loadMapsObs$ = mapsManager.getMaps(version);
loadMapsObs$.pipe(map(progess => {
console.log(progess);
return Math.floor(((progess.loaded / progess.total) * 100));
})).subscribe(percent => loadPercent$.next(percent));
@@ -29,7 +29,6 @@ export function VersionViewer() {
const [currentTabIndex, setCurrentTabIndex] = useState(0);
const navigateToVersion = (version?: BSVersion) => {
console.log(version);
if(!version){
return navigate("/available-versions");
}
@@ -115,8 +115,6 @@ export class MapsManagerService {
const progress$ = this.ipcService.sendV2<DeleteMapsProgress>("delete-maps", {args: maps}).pipe(map(progress => (progress.deleted / progress.total) * 100));
progress$.subscribe(console.log);
showProgressBar && this.progressBar.show(progress$, true);
progress$.toPromise().finally(() => this.progressBar.hide(true));
@@ -17,8 +17,8 @@ export class BeatSaverService {
}
public async getMapDetailsFromHashs(hashs: string[]): Promise<BsvMapDetail[]>{
const res = await this.ipc.send<BsvMapDetail[], string[]>("bsv-get-map-details-from-hashs", {args: hashs});
return res.data ?? [];
//const res = await this.ipc.send<BsvMapDetail[], string[]>("bsv-get-map-details-from-hashs", {args: hashs});
return [];
}