Skip to content

Commit

Permalink
show spinner in v2
Browse files Browse the repository at this point in the history
  • Loading branch information
dipta007 committed Jan 7, 2024
1 parent c186104 commit ac23c33
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions scripts/leetcode.js
Original file line number Diff line number Diff line change
Expand Up @@ -894,10 +894,10 @@ LeetCodeV2.prototype.insertToAnchorElement = function (elem) {
return;
}

if (checkElem(document.getElementsByClassName('ml-auto flex items-center space-x-4'))) {
const target = document.getElementsByClassName('ml-auto flex items-center space-x-4')[0];
if (checkElem(document.getElementsByClassName('ml-auto'))) {
const target = document.getElementsByClassName('ml-auto')[0];
elem.className = 'runcode-wrapper__8rXm';
if (target.childNodes.length > 0) target.childNodes[0].prepend(elem);
if (target.childNodes.length > 0) target.prepend(elem);
}
};
LeetCodeV2.prototype.markUploaded = function () {
Expand Down Expand Up @@ -945,6 +945,8 @@ chrome.storage.local.get('isSync', data => {

const loader = (leetCode) => {
let iterations = 0;
// start upload indicator here
leetCode.startSpinner();
const intervalId = setInterval(async () => {
try {
const isSuccessfulSubmission = leetCode.getSuccessStateAndUpdate();
Expand Down Expand Up @@ -979,9 +981,6 @@ const loader = (leetCode) => {
throw new Error('Could not find language');
}

// start upload indicator here
leetCode.startSpinner();

/* Upload README */
const updateReadMe = await chrome.storage.local.get('stats').then(({ stats }) => {
const shaExists = stats?.shas?.[problemName]?.['README.md'] !== undefined;
Expand Down

0 comments on commit ac23c33

Please sign in to comment.