Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

destroy error #21

Closed
verscm opened this issue Jun 9, 2020 · 1 comment · Fixed by #23
Closed

destroy error #21

verscm opened this issue Jun 9, 2020 · 1 comment · Fixed by #23
Assignees
Labels
🐞 Bug Something isn't working

Comments

@verscm
Copy link

verscm commented Jun 9, 2020

this is destroy example:


'use strict';

const { Workbook, Topic, Zipper, Marker } = require('xmind');

const workbook = new Workbook();
const topic = new Topic({sheet: workbook.createSheet('sheet-1', 'central topic')});

const marker = new Marker();
const zip = new Zipper({path: '/tmp', workbook});

const mainTopic1 = topic.add({title: 'main topic 1'}).cid();
const mainTopic2 = topic.add({title: 'main topic 2'}).cid();
const mainTopic3 = topic.add({title: 'repeated'}).cid();
const mainTopic4 = topic.add({title: 'repeated'}).cid();


topic
  .on(mainTopic1)
  .add({title: 'subtopic 1'})
  .add({title: 'subtopic 2'});

const subtopic1 = topic.on(mainTopic3).add({title: 'subtopic 1'}).cid();
topic.on(subtopic1)
  .note('this is a note text')
  .marker(marker.smiley('cry'))
  // destroy marker from current component
  .marker(Object.assign({}, marker.smiley('cry'), {del: true}));
  
const summaryId = topic.summary({title: 'Summary'}).cid();

// The destroyed operation does not depends on the parent node
topic
  .destroy(topic.cid('subtopic 2'))
  .destroy(mainTopic4)
  .destroy(summaryId)
  .destroy(mainTopic2);

zip.save().then(status => status && console.log('Saved'));

the result shows in xmind2020 APP:
Screen Shot 2020-06-09 at PM15 19 11

ERROR is that program is to destroy maintopic2 but sdk destroy maintopic1.

@danielsss danielsss linked a pull request Jun 12, 2020 that will close this issue
@danielsss danielsss self-assigned this Jun 12, 2020
@danielsss danielsss added the 🐞 Bug Something isn't working label Jun 12, 2020
@danielsss
Copy link
Member

@verscm

Thanks for your feedback. This is an obviously bug, and it already fixed with version of xmind@2.2.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants