Skip to content

Commit

Permalink
refactor: follow up on PR comments
Browse files Browse the repository at this point in the history
Signed-off-by: Pedro Lamas <[email protected]>
  • Loading branch information
pedrolamas committed Aug 1, 2022
1 parent 7cceb70 commit faa8e01
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -215,21 +215,22 @@ export default class App extends Mixins(StateMixin) {
this.flashMessage.open = true
})
const clearNodes = (item: Element) => {
const parentElement = item.parentElement
if (parentElement) {
parentElement.removeChild(item)
}
}
const legacyFavIcons = document.querySelectorAll("link[rel*='icon'][type='image/png']")
const legacyElementsSelectors = [
"link[rel*='icon'][type='image/png']",
"meta[name='theme-color']"
]
legacyFavIcons.forEach(clearNodes)
for (const legacyElementsSelector of legacyElementsSelectors) {
const legacyElements = document.querySelectorAll(legacyElementsSelector)
const legacyThemeColor = document.querySelectorAll("meta[name='theme-color']")
legacyElements.forEach(item => {
const parentElement = item.parentElement
legacyThemeColor.forEach(clearNodes)
if (parentElement) {
parentElement.removeChild(item)
}
})
}
}
handleToolsDrawerChange () {
Expand Down

0 comments on commit faa8e01

Please sign in to comment.