Remove all instances of inject, replace with VueX store

This commit is contained in:
Alicia Sykes
2021-10-09 19:24:51 +01:00
parent 8a8166bb47
commit b55f96c839
16 changed files with 97 additions and 75 deletions

View File

@@ -53,7 +53,6 @@ import { localStorageKeys, serviceEndpoints } from '@/utils/defaults';
export default {
name: 'Item',
inject: ['config'],
props: {
id: String, // The unique ID of a tile (e.g. 001)
title: String, // The main text of tile, required
@@ -77,6 +76,11 @@ export default {
statusCheckInterval: Number,
statusCheckAllowInsecure: Boolean,
},
computed: {
appConfig() {
return this.$store.getters.appConfig;
},
},
data() {
return {
contextMenuOpen: false,
@@ -110,7 +114,7 @@ export default {
this.$emit('itemClicked');
}
// Update the most/ last used ledger, for smart-sorting
if (!this.config.appConfig.disableSmartSort) {
if (!this.appConfig.disableSmartSort) {
this.incrementMostUsedCount(this.id);
this.incrementLastUsedCount(this.id);
}