diff --git a/public/js/app.js b/public/js/app.js index 2046006..bc24de2 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -15,6 +15,7 @@ const App = { motivationalPhrases: [], drafts: {}, tabs: [], + lastListView: '#/tickets', loadTabs() { try { @@ -232,6 +233,10 @@ const App = { const hash = fullHash.split('?')[0]; const titleEl = document.getElementById('page-title'); + if (hash === '#/tickets' || hash === '#/tickets/my') { + this.lastListView = hash; + } + // Save draft for previous ticket before routing if (typeof TicketDetailView !== 'undefined' && TicketDetailView.ticketId) { TicketDetailView.saveDraft(); diff --git a/public/js/views/ticketDetail.js b/public/js/views/ticketDetail.js index 9e3c5f2..f1f7dbf 100644 --- a/public/js/views/ticketDetail.js +++ b/public/js/views/ticketDetail.js @@ -60,7 +60,7 @@ const TicketDetailView = { await App.ensureLookups(); const data = await App.api(`/api/tickets/${id}`); const { ticket, articles, attachments } = data; - App.addTabWithoutRedirect(ticket.id, ticket.tn, ticket.title); + // No automatic tab creation here anymore let groupsData = { asMaster: [], asMember: [] }; try { @@ -107,7 +107,7 @@ const TicketDetailView = { const emailBtnText = hasEmailDraft ? 'Continua mail' : 'Invia Email'; container.innerHTML = ` - + Torna alla lista