Code style improvments, to pass SonarCloud review

This commit is contained in:
Alicia Sykes
2021-12-27 00:39:30 +00:00
parent fac3e8e456
commit 15eddb1565
13 changed files with 25 additions and 55 deletions
+6 -9
View File
@@ -1,7 +1,6 @@
/**
* Mixin for all homepages (default home, minimal home, workspace, etc)
*/
// import ErrorHandler from '@/utils/ErrorHandler';
import Defaults, { localStorageKeys, iconCdns } from '@/utils/defaults';
import { searchTiles } from '@/utils/Search';
@@ -48,16 +47,14 @@ const HomeMixin = {
},
/* Checks if any sections or items use icons from a given CDN */
checkIfIconLibraryNeeded(prefix) {
let isNeeded = false;
if (!this.sections) return false;
let isNeeded = false; // Will be set to true if prefix found in icon name
this.sections.forEach((section) => {
if (section) {
if (section.icon && section.icon.includes(prefix)) isNeeded = true;
if (section.items) {
section.items.forEach((item) => {
if (item.icon && item.icon.includes(prefix)) isNeeded = true;
});
}
if (section && section.icon && section.icon.includes(prefix)) isNeeded = true;
if (section && section.items) {
section.items.forEach((item) => {
if (item.icon && item.icon.includes(prefix)) isNeeded = true;
});
}
});
return isNeeded;