Merge branch 'toast'

toast
Kit Kasune 3 years ago
commit 2d4a086ed6
  1. 6
      scripts/contextmenu/newfolder.js

@ -7,6 +7,7 @@ const preModal = require('../modal/pre');
const postModal = require('../modal/post'); const postModal = require('../modal/post');
const showError = require('../modal/common/error'); const showError = require('../modal/common/error');
const clearModals = require('../modal/clearmodals'); const clearModals = require('../modal/clearmodals');
const newToast = require('../toast/createtoast');
module.exports = () => { module.exports = () => {
if (window.kade.modal) {console.log('hboonk'); return;} if (window.kade.modal) {console.log('hboonk'); return;}
@ -54,11 +55,12 @@ module.exports = () => {
fs.mkdirSync(path.join(window.kade.cpath, input.value)); fs.mkdirSync(path.join(window.kade.cpath, input.value));
lightRefresh(); lightRefresh();
modalOut.remove(); modalOut.remove();
postModal(modalOut.id); newToast("Folder created", [`Folder "${input.value}" created successfully`, `<em>${window.kade.cpath}\\${input.value}</em>`]);
} catch { } 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(); 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); cont.appendChild(conf);
input.focus(); input.focus();

Loading…
Cancel
Save