From cb30a0374aad8fb1d441c096f5c9fbd21ca25410 Mon Sep 17 00:00:00 2001 From: ThinLiquid Date: Tue, 16 Jan 2024 06:07:25 +0000 Subject: [PATCH] =?UTF-8?q?[=F0=9F=90=9B]=20Fixed=20file=20renaming=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/system/apps/Files.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/system/apps/Files.ts b/src/system/apps/Files.ts index 8e4b042..bbcba40 100644 --- a/src/system/apps/Files.ts +++ b/src/system/apps/Files.ts @@ -47,14 +47,14 @@ const Files: Process = { } (win.content.querySelector('.file') as HTMLElement).onclick = async () => { - const title: string | null | undefined = prompt('Enter file name') + const title = prompt('Enter file name') if (title != null) { await fs.writeFile(`${dir}/${title}`, '') } } (win.content.querySelector('.folder') as HTMLElement).onclick = async () => { - const title: string | null | undefined = prompt('Enter folder name') + const title = prompt('Enter folder name') if (title != null) { await fs.mkdir(`${dir}/${title}`, '') } @@ -73,8 +73,8 @@ const Files: Process = { element.innerHTML += `${icon} ${file}delete_foreveredit`; (element.querySelector('.rename') as HTMLElement).onclick = async () => { - const value = (prompt('Rename') as string) - if (value !== null || value !== undefined) { + const value = prompt('Rename') + if (value != null) { await fs.rename(dir + seperator + file, dir + seperator + value) } }