Hey,
I’m trying to set some variables by making calls to my server and getting those values from the client-side. This is what I have:
var count = 0;
var nRepos = 0;
requestRepoNames().then(async (repoNames) => {
nRepos = repoNames.length;
for (let i = 0; i < repoNames.length; i++) {
console.log(repoNames[i]);
count += await requestCommitCount(repoNames[i]);
console.log(count);
}
window.onload = () => {
document.getElementById(
"git-stats"
).innerHTML = `Haad has made ${count} commits in ${nRepos} repositories since August, 2022`;
};
});
This doesn’t change the element though, I already made sure that there was no spelling error in the “git-stats” id. Any ideas on why the window is not getting updated?