perf: run on nextTick only if necessary
This commit is contained in:
@@ -84,11 +84,20 @@ watch([content, mode], () => {
|
||||
|
||||
nextTick(() => {
|
||||
listenToClick()
|
||||
useImages(props.sha)
|
||||
generateTweets()
|
||||
mermaid.run({
|
||||
querySelector: `.note-${sha.value} .mermaid`,
|
||||
})
|
||||
|
||||
if (/\!\[.*?\]\(.*?\)/.test(rawContent.value)) {
|
||||
useImages(props.sha)
|
||||
}
|
||||
|
||||
if (rawContent.value.includes("@[tweet]")) {
|
||||
generateTweets()
|
||||
}
|
||||
|
||||
if (rawContent.value.includes("```mermaid")) {
|
||||
mermaid.run({
|
||||
querySelector: `.note-${sha.value} .mermaid`,
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -17,15 +17,6 @@ export const useNoteOverlay = (
|
||||
const displayNoteOverlay = computed(() => {
|
||||
const valueIndex = toValue(index)
|
||||
|
||||
if (valueIndex === 1) {
|
||||
console.log(
|
||||
valueIndex,
|
||||
x.value > valueIndex * NOTE_WIDTH,
|
||||
x.value,
|
||||
valueIndex * NOTE_WIDTH,
|
||||
)
|
||||
}
|
||||
|
||||
if (isMobile.value) {
|
||||
return y.value > valueIndex * noteHeight.value
|
||||
} else {
|
||||
|
||||
@@ -114,8 +114,6 @@ export const useUserRepoStore = defineStore("USER_REPO_STATE", {
|
||||
return
|
||||
}
|
||||
|
||||
console.log("add file")
|
||||
|
||||
const savedRepoId = data.generateId(
|
||||
DataType.SavedRepo,
|
||||
`${this.user}-${this.repo}`,
|
||||
|
||||
Reference in New Issue
Block a user