Skip to content

Commit

Permalink
hacky implementation of localStorage to remember if chat dialog is open
Browse files Browse the repository at this point in the history
  • Loading branch information
xinaesthete committed Feb 14, 2025
1 parent b2ca2f1 commit bc40aea
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/charts/ChartManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,25 @@ export class ChartManager {
position: "bottom-left"
},
func: async () => {
new ChatDialog();
if (this.chatDialog) {
this.chatDialog.close();
} else {
this.chatDialog = new ChatDialog();
localStorage.setItem('chatMDV', true);
this.chatDialog.config.onclose = () => {
this.chatDialog = null;
localStorage.removeItem('chatMDV');
}
}
}
}, this.rightMenuBar);
if (localStorage.getItem('chatMDV')) {
this.chatDialog = new ChatDialog();
this.chatDialog.config.onclose = () => {
this.chatDialog = null;
localStorage.removeItem('chatMDV');
}
}
// chatButton.setAttribute('data-lucide', 'bot-message-square'); //didn't work
createMenuIcon("fas fa-file-alt", {
tooltip: {
Expand Down

0 comments on commit bc40aea

Please sign in to comment.