diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index 95bb459..289e101 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -13,9 +13,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: - ref: ${{ github.head_ref }} + ref: ${{ github.event.pull_request.head.sha }} - name: Prettify uses: creyD/prettier_action@v4.2 with: diff --git a/js/ui/tool/dream.js b/js/ui/tool/dream.js index fdd5733..a2893d5 100644 --- a/js/ui/tool/dream.js +++ b/js/ui/tool/dream.js @@ -222,7 +222,7 @@ const _generate = async ( at--; if (at < 0) at = images.length - 1; - imageindextxt.textContent = `${at}/${images.length}`; + imageindextxt.textContent = `${at}/${images.length - 1}`; redraw(); }; @@ -230,7 +230,7 @@ const _generate = async ( at++; if (at >= images.length) at = 0; - imageindextxt.textContent = `${at}/${images.length}`; + imageindextxt.textContent = `${at}/${images.length - 1}`; redraw(); }; @@ -256,7 +256,7 @@ const _generate = async ( interruptButton.disabled = false; imageCollection.inputElement.appendChild(interruptButton); images.push(...(await _dream(endpoint, requestCopy))); - imageindextxt.textContent = `${at}/${images.length}`; + imageindextxt.textContent = `${at}/${images.length - 1}`; } catch (e) { alert( `Error generating images. Please try again or see consolde for more details` @@ -330,11 +330,11 @@ const _generate = async ( imageSelectMenu = makeElement("div", bb.x, bb.y + bb.h); const imageindextxt = document.createElement("button"); - imageindextxt.textContent = `${at}/${images.length}`; + imageindextxt.textContent = `${at}/${images.length - 1}`; imageindextxt.addEventListener("click", () => { at = 0; - imageindextxt.textContent = `${at}/${images.length}`; + imageindextxt.textContent = `${at}/${images.length - 1}`; redraw(); });