Skip to content

Commit

Permalink
Merge pull request #791 from meiamsome/maint/fix-lint-issues
Browse files Browse the repository at this point in the history
MAINT: Fix lint issues
  • Loading branch information
sphinxrave authored Dec 29, 2024
2 parents 9c2789c + 8271e84 commit f13de2b
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 18 deletions.
10 changes: 5 additions & 5 deletions src/mixins/filterVideos.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ export default {
const favoriteChannels = this.$store.getters["favorites/favoriteChannelIDs"];
// eslint-disable-next-line no-param-reassign
forOrg ||= this.$store.state.currentOrg.name;
let hiddenGroups = this.$store.state.settings.hiddenGroups;
const validOrgs = Object.keys(hiddenGroups)
const { hiddenGroups } = this.$store.state.settings;
const validOrgs = Object.keys(hiddenGroups);
const orgGroupsHidden = validOrgs.includes(v.channel.org);

let keep = true;
Expand All @@ -32,8 +32,8 @@ export default {
// TODO: Update to suport hideViaGroup: mentions needs suborg field on API
if (!isFavoritedOrInOrg) {
keep &&= !hideCollabs && !v.mentions?.every(
({ id, org, suborg }) => (blockedChannels.has(id) ||
(hideGroups && validOrgs.includes(org) && hiddenGroups[org].includes((`${suborg}`).slice(2) || "Other"))
({ id, org, suborg }) => (blockedChannels.has(id)
|| (hideGroups && validOrgs.includes(org) && hiddenGroups[org].includes((`${suborg}`).slice(2) || "Other"))
|| (org !== forOrg && !favoriteChannels.has(id))),
);
}
Expand All @@ -49,7 +49,7 @@ export default {
if (hideMissing) {
keep &&= v.status !== "missing";
}

if (hideGroups) {
if (orgGroupsHidden) {
keep &&= !hideViaGroup;
Expand Down
19 changes: 9 additions & 10 deletions src/plugins/vuetify.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,27 +37,26 @@ export const langs = [
{ val: "th", display: "ไทย", credit: "SnowNeko#0282" },
];

const possibleChars = [768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 794, 795, 829, 830, 831, 832, 833, 834, 835, 836, 838, 842, 843, 844, 848, 849, 850, 855, 856, 859, 861, 862, 864, 865, 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 820, 821, 822, 823, 824, 790, 791, 792, 793, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 825, 826, 827, 828, 837, 839, 840, 841, 845, 846, 851, 852, 853, 854, 857, 858, 860, 863, 866,];
const randInt = upperBound => Math.floor(Math.random() * upperBound);
const possibleChars = [768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 794, 795, 829, 830, 831, 832, 833, 834, 835, 836, 838, 842, 843, 844, 848, 849, 850, 855, 856, 859, 861, 862, 864, 865, 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 820, 821, 822, 823, 824, 790, 791, 792, 793, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 825, 826, 827, 828, 837, 839, 840, 841, 845, 846, 851, 852, 853, 854, 857, 858, 860, 863, 866];
const randInt = (upperBound) => Math.floor(Math.random() * upperBound);

function combiningChars() {
return () => String.fromCharCode(possibleChars[randInt(possibleChars.length)]);
}

const repeat = (fn, count) => {
const result = []
for (let i = 0; i < count; i++) {
result.push(fn())
const result = [];
for (let i = 0; i < count; i += 1) {
result.push(fn());
}
return result
}

return result;
};

export const zalgo = (str) => {
let mstr = str;
const mstr = str;
const n = 0.5;
const randomCombiningChar = combiningChars();
return mstr.split('').map((char, i) => `${char}${repeat(randomCombiningChar, n).join('')}`).join('');;
return mstr.split("").map((char) => `${char}${repeat(randomCombiningChar, n).join("")}`).join("");
};

export const asyncLang = {
Expand Down
2 changes: 1 addition & 1 deletion src/store/settings.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ const mutations = {
const groupName = `${group.title}`.toLowerCase();
const orgName = `${group.org}`;
if (!state.hiddenGroups) Vue.set(state, "hiddenGroups", {});
if (!state.hiddenGroups[orgName]) Vue.set(state.hiddenGroups, `${orgName}`, [])
if (!state.hiddenGroups[orgName]) Vue.set(state.hiddenGroups, `${orgName}`, []);

// determine to add or subtract:
if (state.hiddenGroups[orgName].includes(groupName)) {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/consts.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export const TL_LANGS = Object.freeze([
export const langConversion = Object.freeze({
"lol-PEKO": "en",
"lol-UWU": "en",
"zh": "zh-Hant",
zh: "zh-Hant",
"zh-CN": "zh-Hans",
});

Expand Down
2 changes: 1 addition & 1 deletion src/utils/time.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export function localizedDayjs(time, lang) {
return dayjs(time);
}

export function titleTimeString(available_at, lang ) {
export function titleTimeString(available_at, lang) {
const ts = localizedDayjs(available_at, lang);
const ts1 = ts.format(`${ts.isTomorrow() ? "ddd " : ""}LT zzz`);
const ts2 = ts
Expand Down

0 comments on commit f13de2b

Please sign in to comment.