-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fix variants bugs #1 #484
Fix variants bugs #1 #484
Conversation
…y child of its parent
…s for the variants tab
@@ -61,10 +61,12 @@ onBeforeUnmount(() => unsubscribe()) | |||
|
|||
function allocateWitnessColorInVariantItem() { | |||
const colors = {} | |||
annotationStore.witnesses.forEach((witness, i) => { | |||
if(annotationStore.witnesses?.length > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use "early return" pattern, since wrapping an "if" around some code is kind of ugly
src/stores/annotations.ts
Outdated
|
||
if (!target) { | ||
if (!target || target.getAttribute('data-annotation-level') < 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We identified today that this wasn't really the issue of the bug. So this is not needed anymore I guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, true.
src/utils/annotations.js
Outdated
let witnessesHtmlEl = parentEl.children[indexOfTarget-1] | ||
witnessesHtmlEl.appendChild(witHtml) | ||
} | ||
} | ||
|
||
function createWitnessesHtml(witHtml, parentEl, targetHtmlEl) { | ||
const witnessesHtmlEl = document.createElement("span"); | ||
witnessesHtmlEl.classList.add('witnesses') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can omit the words"witnessesHtml" if those are already in your function name (btw this applies also for classes or components). Call it "resultEl" or just "el", it will be fine.
76364d1
to
aa0d73d
Compare
For now, I am done with this PR. Please continue reviewing. |
@paulpestov from my side I am done with this PR. Please continue reviewing. |
No description provided.