From 614934217d12940dbf56d8b9b4f42d4f98bb6d34 Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Sun, 12 Dec 2021 00:30:35 -0700 Subject: [PATCH] newfolder errortoast into errormodal --- scripts/contextmenu/newfolder.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/contextmenu/newfolder.js b/scripts/contextmenu/newfolder.js index b9c7294..aa4f49e 100644 --- a/scripts/contextmenu/newfolder.js +++ b/scripts/contextmenu/newfolder.js @@ -7,6 +7,7 @@ const preModal = require('../modal/pre'); const postModal = require('../modal/post'); const showError = require('../modal/common/error'); const clearModals = require('../modal/clearmodals'); +const newToast = require('../toast/createtoast'); module.exports = () => { if (window.kade.modal) {console.log('hboonk'); return;} @@ -54,11 +55,12 @@ module.exports = () => { fs.mkdirSync(path.join(window.kade.cpath, input.value)); lightRefresh(); modalOut.remove(); - postModal(modalOut.id); + newToast("Folder created", [`Folder "${input.value}" created successfully`, `${window.kade.cpath}\\${input.value}`]); } catch { + newToast("Folder not Created", "An error caused that folder to not be created.", "#b24355", false, 5, () => {showError("Folder Creation", "There was an unknown error while trying to create that folder. It may be a permissions issue, or the host folder doesn't exist anymore.");}); clearModals(); - showError("Folder Creation", "There was an unknown error while trying to create that folder. It may be a permissions issue, or the host folder doesn't exist anymore."); } + postModal(modalOut.id); }; cont.appendChild(conf); input.focus();