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 {
<span>
<gl-loading-icon v-if="loading" :inline="true" />
<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 }" />
</svg>
<gl-icon v-else :name="folderIconName" :size="size" class="folder-icon" />
......
......@@ -61,7 +61,12 @@ export default {
</script>
<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 }" />
</svg>
</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