mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-23 00:05:22 +03:00
coderabbit strikes again
This commit is contained in:
parent
60e7145895
commit
b18a1a811f
1 changed files with 10 additions and 3 deletions
|
@ -119,9 +119,16 @@ Model.prototype.loadGLTF = function (model_file, callback) {
|
|||
},
|
||||
(progress) => {
|
||||
// Optional: Handle loading progress
|
||||
console.log(
|
||||
`Loading progress: ${progress.loaded}/${progress.total} (${Math.round((progress.loaded / progress.total) * 100)}%)`,
|
||||
);
|
||||
if (progress.total > 0) {
|
||||
const pct = Math.round((progress.loaded / progress.total) * 100);
|
||||
if (pct !== this._lastPct) {
|
||||
// throttle identical values
|
||||
this._lastPct = pct;
|
||||
console.log(`Loading progress: ${progress.loaded}/${progress.total} (${pct}%)`);
|
||||
}
|
||||
} else {
|
||||
console.log(`Loading progress: ${progress.loaded} bytes`);
|
||||
}
|
||||
},
|
||||
(error) => {
|
||||
console.error("Error loading model:", error);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue