Created
April 1, 2024 18:41
-
-
Save bjoerntx/aa53c7183dfaff12804a70cf583c80fa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function deleteCommentsByName(index, numComments, TXTextControl, name) { | |
if (index >= numComments) { | |
return; | |
} | |
TXTextControl.comments.elementAt(index, (comment) => { | |
comment.getUserName((author) => { | |
if (author === name) { | |
TXTextControl.comments.remove(comment, () => { | |
TXTextControl.comments.getCount((newNumComments) => { | |
deleteCommentsByName(0, newNumComments, TXTextControl, name); | |
}); | |
}); | |
} else { | |
deleteCommentsByName(index + 1, numComments, TXTextControl, name); | |
} | |
}); | |
}); | |
} | |
TXTextControl.comments.getCount((numComments) => { | |
deleteCommentsByName(0, numComments, TXTextControl, "Tim Typer"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment