Doesnt add nav items if text field is empty

This commit is contained in:
Alicia Sykes
2021-05-18 16:20:35 +01:00
parent aca9cbca11
commit 34e0467889
2 changed files with 46 additions and 17 deletions

View File

@@ -60,7 +60,7 @@ export default {
pageInfo.title = this.formElements.title;
pageInfo.description = this.formElements.description;
pageInfo.footerText = this.formElements.footerText;
pageInfo.navLinks = this.formElements.navLinks;
pageInfo.navLinks = this.formElements.navLinks.filter(link => (link.title !== ''));
localStorage.setItem(localStorageKeys.PAGE_INFO, JSON.stringify(pageInfo));
this.$toasted.show('Changes saved succesfully');
setTimeout(() => { location.reload(); }, 1500); // eslint-disable-line no-restricted-globals