diff --git a/client/homebrew/navbar/newbrew.navitem.jsx b/client/homebrew/navbar/newbrew.navitem.jsx index 4914782a5..b8cf82ab7 100644 --- a/client/homebrew/navbar/newbrew.navitem.jsx +++ b/client/homebrew/navbar/newbrew.navitem.jsx @@ -34,25 +34,20 @@ const NewBrew = ()=>{ alert(`This file is invalid: ${!type ? 'Missing file extension' :`.${type} files are not supported`}. Only .txt files exported from the Homebrewery are allowed.`); - console.log(file); }; reader.readAsText(file); }; - const checkLocalStorage = ()=>{ - // Check if changes exist for New editor - const currentText = localStorage.getItem(BREWKEY); - const currentStyle = localStorage.getItem(STYLEKEY); - const currentMeta = localStorage.getItem(METAKEY); - return (currentText || currentStyle || currentMeta); - }; - const confirmLocalStorageChange = ()=>{ + const currentText = localStorage.getItem(BREWKEY); + const currentStyle = localStorage.getItem(STYLEKEY); + const currentMeta = localStorage.getItem(METAKEY); + // TRUE if no data in any local storage key // TRUE if data in any local storage key AND approval given // FALSE if data in any local storage key AND approval declined - return (!checkLocalStorage() || confirm( + return (!(currentText || currentStyle || currentMeta) || confirm( `You have made changes in the new brew space. If you continue, that information will be PERMANENTLY LOST.\nAre you sure you wish to continue?` )); }; @@ -75,7 +70,7 @@ const NewBrew = ()=>{ className='new' color='purple' icon='fa-solid fa-plus-square'> - new + new { newTab={true} color='purple' icon='fa-solid fa-file'> - resume editing + resume draft { color='yellow' icon='fa-solid fa-file-circle-plus' onClick={()=>{ clearLocalStorage(); }}> - from blank + from blank - { document.getElementById('uploadTxt').click(); }}> - from file + from file );