From 0c8c478016939492062c65e10725df48e3b00b67 Mon Sep 17 00:00:00 2001 From: isntlazy Date: Thu, 18 Jan 2024 14:18:59 +0200 Subject: [PATCH] fixed bugs with saving and exporting session --- src/components/ControlPanel.vue | 5 +++-- src/components/ExportPanel.vue | 3 ++- src/modules/FileSystemUtility.js | 8 +++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/ControlPanel.vue b/src/components/ControlPanel.vue index cd70c755..2b72204d 100644 --- a/src/components/ControlPanel.vue +++ b/src/components/ControlPanel.vue @@ -1638,8 +1638,9 @@ export default { }, async saveSession(callback = null) { this.newSessionDialog = false; + const sessionId = await this.$storageService.getSessionId(); const data = { - id: this.$store.state.id, + id: sessionId, title: this.$store.state.title, charter: this.$store.state.charter, mindmap: this.$store.state.mindmap, @@ -1738,7 +1739,7 @@ export default { this.isDuration = false; this.duration = 0; - this.$store.commit("resetState"); + this.$store.commit("clearState"); await this.$storageService.resetData(); if (this.$isElectron) { diff --git a/src/components/ExportPanel.vue b/src/components/ExportPanel.vue index d405de10..61c275b6 100644 --- a/src/components/ExportPanel.vue +++ b/src/components/ExportPanel.vue @@ -123,8 +123,9 @@ export default { }, methods: { async exportSession() { + const sessionId = await this.$storageService.getSessionId(); const data = { - id: this.$store.state.id, + id: sessionId, title: this.$store.state.title, charter: this.$store.state.charter, preconditions: this.$store.state.preconditions, diff --git a/src/modules/FileSystemUtility.js b/src/modules/FileSystemUtility.js index 0bb4a30d..11df8b45 100644 --- a/src/modules/FileSystemUtility.js +++ b/src/modules/FileSystemUtility.js @@ -73,11 +73,9 @@ module.exports.saveSession = async (data) => { "yattie-session-" + dayjs().format("YYYY-MM-DD_HH-mm-ss-ms") + "-notes.txt"; const notes = databaseUtility.getNotes(); let notesFilePath = ""; - if (notes.text !== "") { - notesFilePath = captureUtility.saveNote({ - fileName: notesFileName, - comment: notes, - }); + if (notes.text) { + const notesItem = captureUtility.saveNote(notes, notesFileName) + notesFilePath = notesItem.item.filePath; } const fileName = "TestSession.test";