Skip to content
Snippets Groups Projects
Commit e2cdcd12 authored by Julian's avatar Julian
Browse files

Fix hashing mechanism in ColoredShortNameChip.vue

parent b367816d
No related branches found
No related tags found
1 merge request!50Resolve "Implement bundled courses/lessons"
...@@ -61,6 +61,11 @@ export default { ...@@ -61,6 +61,11 @@ export default {
}, },
}, },
computed: { computed: {
color() {
return this.overrideColor
? this.defaultColor
: colors[((this.hash % colors.length) + colors.length) % colors.length];
},
// Returns an integer hash based on the shortName of the supplied item // Returns an integer hash based on the shortName of the supplied item
hash() { hash() {
return this.item.shortName return this.item.shortName
...@@ -82,11 +87,6 @@ export default { ...@@ -82,11 +87,6 @@ export default {
// As color[1] can be a boolean or a color // As color[1] can be a boolean or a color
return this.color[1] === true; return this.color[1] === true;
}, },
color() {
return this.overrideColor
? this.defaultColor
: colors[this.hash % colors.length];
},
}, },
}; };
</script> </script>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment