deleteList(listId) {

		// Delete list from array
		let listIndex = this.lists.findIndex((id) => id === listId);
		this.lists.splice(listIndex, 1);
		
		// Find the next list to render
		
		let nextListId = this.lists[0];

		if (!nextListId) {
			StateRenderingModule.showStartPage(true);
			DatabaseInfoModule.deleteInfo(database, "To-do information", {key: "currentList"});
			DatabaseInfoModule.deleteInfo(database, "To-do information", {key: "currentListIndex"});
			DatabaseInfoModule.deleteInfo(database, "To-do information", {key: "lists"});
			this.currentList = null;
			this.currentListIndex = 1;
		} else {
			this.switchToList(nextListId);
			DatabaseInfoModule.saveInfo(database, "To-do information", {key: "lists", value: this.lists});
		}
		// Remove list from navbar
		RenderingModule.removeListFromNavbar(listId);

		// Delete list from database and ToDo
		DatabaseInfoModule.deleteInfo(database, "Lists", {key: listId});
	}
/**
	 * Removes the specified list from the DOM, renders another one, and deletes the specified list from the database
	 * @param {string} listId The id of the deleted list
	 */
Removes the specified list from the DOM, renders another one, and deletes the specified list from the database
@param {string} listId The id of the deleted list
Removes the specified list from the DOM renders another one and deletes the specified list from the database @param { string } listId The id of the deleted list
deleteList(listId) {
		let listIndex = this.lists.findIndex((id) => id === listId);
		this.lists.splice(listIndex, 1);
		let nextListId = this.lists[0];
		if (!nextListId) {
			StateRenderingModule.showStartPage(true);
			DatabaseInfoModule.deleteInfo(database, "To-do information", {key: "currentList"});
			DatabaseInfoModule.deleteInfo(database, "To-do information", {key: "currentListIndex"});
			DatabaseInfoModule.deleteInfo(database, "To-do information", {key: "lists"});
			this.currentList = null;
			this.currentListIndex = 1;
		} else {
			this.switchToList(nextListId);
			DatabaseInfoModule.saveInfo(database, "To-do information", {key: "lists", value: this.lists});
		}
		RenderingModule.removeListFromNavbar(listId);
		DatabaseInfoModule.deleteInfo(database, "Lists", {key: listId});
	}
deleteList ( listId ) { let listIndex = this . lists . findIndex ( ( id ) => id === listId ) ; this . lists . splice ( listIndex , 1 ) ; let nextListId = this . lists [ 0 ] ; if ( ! nextListId ) { StateRenderingModule . showStartPage ( true ) ; DatabaseInfoModule . deleteInfo ( database , "To-do information" , { key : "currentList" } ) ; DatabaseInfoModule . deleteInfo ( database , "To-do information" , { key : "currentListIndex" } ) ; DatabaseInfoModule . deleteInfo ( database , "To-do information" , { key : "lists" } ) ; this . currentList = null ; this . currentListIndex = 1 ; } else { this . switchToList ( nextListId ) ; DatabaseInfoModule . saveInfo ( database , "To-do information" , { key : "lists" , value : this . lists } ) ; } RenderingModule . removeListFromNavbar ( listId ) ; DatabaseInfoModule . deleteInfo ( database , "Lists" , { key : listId } ) ; }
Removes the specified list from the DOM, renders another one, and deletes the specified list from the database
 @param {string} listId The id of the deleted list
Removes the specified list from the DOM renders another one and deletes the specified list from the database @param { string } listId The id of the deleted list
// Delete list from array // Find the next list to render // Remove list from navbar // Delete list from database and ToDo