Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

Commit

Permalink
🚑 Fix some DOM errors on ramwatcher's swap bar
Browse files Browse the repository at this point in the history
...that occured when the swap usage was below 0
  • Loading branch information
GitSquared committed Apr 30, 2019
1 parent a1114d9 commit aeabef7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/classes/ramwatcher.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class RAMwatcher {

// Update swap indicator
let usedSwap = Math.round((100*data.swapused)/data.swaptotal);
document.getElementById("mod_ramwatcher_swapbar").value = usedSwap;
document.getElementById("mod_ramwatcher_swapbar").value = usedSwap || 0;

let usedSwapGiB = Math.round((data.swapused/1073742000)*10)/10;
document.getElementById("mod_ramwatcher_swaptext").innerText = `${usedSwapGiB} GiB`;
Expand Down

0 comments on commit aeabef7

Please sign in to comment.