Skip to content

Commit

Permalink
Merge pull request #117 from yatt-ai/ok/save-export-session-fix
Browse files Browse the repository at this point in the history
fixed bugs with saving and exporting session
  • Loading branch information
dacoaster authored Jan 18, 2024
2 parents e2a059d + 0c8c478 commit e6aa4d5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
5 changes: 3 additions & 2 deletions src/components/ControlPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion src/components/ExportPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 3 additions & 5 deletions src/modules/FileSystemUtility.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit e6aa4d5

Please sign in to comment.