refactor to method

This commit is contained in:
liamcottle
2024-03-29 23:57:37 +13:00
parent 62aa2748b2
commit 8b54758a40

View File

@ -1159,7 +1159,7 @@
isShowingHardwareModels: false,
hardwareModelStats: null,
isShowingInfoModal: !window.isMobile() && !window.getConfigHasSeenInfoModal(),
isShowingInfoModal: this.shouldShowInfoModal(),
isShowingMobileSearch: false,
isShowingSettings: false,
@ -1203,6 +1203,10 @@
},
methods: {
shouldShowInfoModal: function() {
return !window.getConfigHasSeenInfoModal()
&& !window.isMobile();
},
loadHardwareModelStats: function() {
window.axios.get('/api/v1/stats/hardware-models').then((response) => {
this.hardwareModelStats = response.data.hardware_model_stats;