Commit 5080cd40 authored by Lukas Eipert's avatar Lukas Eipert

Force rerendering of sprite icon components

With our new Chrome workaround we might render outdated icons in vue. By
adding a key, we can ensure that the icon component is re-rendered if
the icon that is supposed to be rendered changes.
parent 4c58e9ea
...@@ -87,7 +87,7 @@ export default { ...@@ -87,7 +87,7 @@ export default {
<span> <span>
<gl-loading-icon v-if="loading" :inline="true" /> <gl-loading-icon v-if="loading" :inline="true" />
<gl-icon v-else-if="isSymlink" name="symlink" :size="size" /> <gl-icon v-else-if="isSymlink" name="symlink" :size="size" />
<svg v-else-if="!folder" :class="[iconSizeClass, cssClasses]"> <svg v-else-if="!folder" :key="spriteHref" :class="[iconSizeClass, cssClasses]">
<use v-bind="{ 'xlink:href': spriteHref }" /> <use v-bind="{ 'xlink:href': spriteHref }" />
</svg> </svg>
<gl-icon v-else :name="folderIconName" :size="size" class="folder-icon" /> <gl-icon v-else :name="folderIconName" :size="size" class="folder-icon" />
......
...@@ -61,7 +61,12 @@ export default { ...@@ -61,7 +61,12 @@ export default {
</script> </script>
<template> <template>
<svg :class="[iconSizeClass, iconTestClass]" aria-hidden="true" v-on="$listeners"> <svg
:key="spriteHref"
:class="[iconSizeClass, iconTestClass]"
aria-hidden="true"
v-on="$listeners"
>
<use v-bind="{ 'xlink:href': spriteHref }" /> <use v-bind="{ 'xlink:href': spriteHref }" />
</svg> </svg>
</template> </template>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment