mirror of
https://github.com/romancm/gamebrary
synced 2024-11-24 12:13:08 +00:00
Update tag mutation
This commit is contained in:
parent
e2db5694e4
commit
df262c2e7a
1 changed files with 16 additions and 0 deletions
|
@ -26,6 +26,22 @@ export default {
|
|||
state.wallpaperUrl = url;
|
||||
},
|
||||
|
||||
UPDATE_TAG(state, { tagName, tagHex, tempTag }) {
|
||||
const updatedTag = {
|
||||
...state.tags[tempTag.tagName],
|
||||
hex: tagHex,
|
||||
};
|
||||
|
||||
const renaming = tagName !== tempTag.tagName;
|
||||
|
||||
if (renaming) {
|
||||
Vue.set(state.tags, tagName, updatedTag);
|
||||
Vue.delete(state.tags, tempTag.tagName);
|
||||
} else {
|
||||
state.tags[tempTag.tagName] = updatedTag;
|
||||
}
|
||||
},
|
||||
|
||||
SET_RELEASES(state, releases) {
|
||||
state.releases = releases;
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue