Skip to content

Commit

Permalink
Chore: minor userscript changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Kr328 committed Nov 30, 2022
1 parent 88ab119 commit 14ff8c0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
7 changes: 4 additions & 3 deletions userscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//
// @grant GM_addStyle
//
// @version 1.0
// @version builtin
// ==/UserScript==
(() => {
const defaultServerURL = "%%%SERVER_URL%%%";
Expand Down Expand Up @@ -141,8 +141,9 @@
try {
const resp = await fetch(baseUrl);
const files = JSON.parse(await resp.text());
if (files.files.length != 0) {
for (let file of files.files) {
if (files.files.length !== 0) {
fileList.innerHTML = "";
for (const file of files.files) {
const span = document.createElement("span");
span.innerText = file.name;
span.classList.add("--br-file-item", "--br-clickable");
Expand Down
8 changes: 5 additions & 3 deletions userscript/userscript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//
// @grant GM_addStyle
//
// @version 1.0
// @version builtin
// ==/UserScript==

(() => {
Expand Down Expand Up @@ -155,8 +155,10 @@
const resp = await fetch(baseUrl);
const files = JSON.parse(await resp.text()) as ResponseFileList;

if (files.files.length != 0) {
for (let file of files.files) {
if (files.files.length !== 0) {
fileList.innerHTML = "";

for (const file of files.files) {
const span = document.createElement("span");
span.innerText = file.name;
span.classList.add("--br-file-item", "--br-clickable");
Expand Down

0 comments on commit 14ff8c0

Please sign in to comment.