mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-17 13:25:24 +03:00
Fix and add check for chrome.runtime.lastError
This commit is contained in:
parent
0f8a2911d9
commit
431aa6bac8
13 changed files with 83 additions and 121 deletions
|
@ -592,37 +592,6 @@ function notifyOutdatedVersion(releaseData) {
|
|||
});
|
||||
}
|
||||
|
||||
function microtime() {
|
||||
return new Date().getTime() / 1000;
|
||||
}
|
||||
|
||||
function millitime() {
|
||||
return new Date().getTime();
|
||||
}
|
||||
|
||||
const DEGREE_TO_RADIAN_RATIO = Math.PI / 180;
|
||||
|
||||
function degToRad(degrees) {
|
||||
return degrees * DEGREE_TO_RADIAN_RATIO;
|
||||
}
|
||||
|
||||
function bytesToSize(bytes) {
|
||||
|
||||
let outputBytes;
|
||||
|
||||
if (bytes < 1024) {
|
||||
outputBytes = `${bytes} Bytes`;
|
||||
} else if (bytes < 1048576) {
|
||||
outputBytes = `${(bytes / 1024).toFixed(3)} KB`;
|
||||
} else if (bytes < 1073741824) {
|
||||
outputBytes = `${(bytes / 1048576).toFixed(3)} MB`;
|
||||
} else {
|
||||
outputBytes = `${(bytes / 1073741824).toFixed(3)} GB`;
|
||||
}
|
||||
|
||||
return outputBytes;
|
||||
}
|
||||
|
||||
function isExpertModeEnabled() {
|
||||
return $('input[name="expertModeCheckbox"]').is(':checked');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue