From a62487b36b57934abbe903e0aa66751e119cb908 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Tue, 4 Aug 2026 21:14:09 +0300 Subject: [PATCH] fixes --- src/api/helpers.js | 6 +----- src/components/conversation/conversation.js | 9 ++++----- src/components/settings_modal/helpers/unit_setting.js | 5 ++++- src/services/notification_utils/notification_utils.js | 3 +-- src/services/style_setter/style_setter.js | 4 +++- src/services/sw/sw.js | 6 ++---- src/services/theme_data/theme_data_3.service.js | 2 +- 7 files changed, 16 insertions(+), 19 deletions(-) diff --git a/src/api/helpers.js b/src/api/helpers.js index 22ba41ecb..90956a4dc 100644 --- a/src/api/helpers.js +++ b/src/api/helpers.js @@ -37,11 +37,7 @@ export const paramsString = (params = {}) => { arrays.forEach(([k, array]) => { array.forEach((v) => { - if ( - typeof v === 'object' || - typeof v === 'function' || - v === undefined - ) + if (typeof v === 'object' || typeof v === 'function' || v === undefined) throw new TypeError('Array param cannot contain non-primitives!') }) }) diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js index f05af6f36..d27551c3c 100644 --- a/src/components/conversation/conversation.js +++ b/src/components/conversation/conversation.js @@ -305,11 +305,10 @@ const conversation = { topLevel() { const topLevel = this.conversation.reduce( (tl, cur) => - tl.filter( - (k) => - this.getReplies(cur.id) - .map((v) => v.id) - .includes(k.id), + tl.filter((k) => + this.getReplies(cur.id) + .map((v) => v.id) + .includes(k.id), ), this.conversation, ) diff --git a/src/components/settings_modal/helpers/unit_setting.js b/src/components/settings_modal/helpers/unit_setting.js index f537eab85..3be6b7a10 100644 --- a/src/components/settings_modal/helpers/unit_setting.js +++ b/src/components/settings_modal/helpers/unit_setting.js @@ -67,7 +67,10 @@ export default { return this.$t(['settings', 'units', this.unitSet, value].join('.')) }, updateValue(e) { - this.configSink(this.path, Number.parseFloat(e.target.value) + this.stateUnit) + this.configSink( + this.path, + Number.parseFloat(e.target.value) + this.stateUnit, + ) }, updateUnit(e) { let value = this.stateValue diff --git a/src/services/notification_utils/notification_utils.js b/src/services/notification_utils/notification_utils.js index 107b183c2..9e443bf8b 100644 --- a/src/services/notification_utils/notification_utils.js +++ b/src/services/notification_utils/notification_utils.js @@ -95,8 +95,7 @@ export const filteredNotificationsFromStore = ( types, ) => { // map is just to clone the array since sort mutates it and it causes some issues - const sortedNotifications = notificationsFromStore(store) - .sort(sortById) + const sortedNotifications = notificationsFromStore(store).sort(sortById) // TODO implement sorting elsewhere and make it optional return sortedNotifications.filter((notification) => (types || visibleTypes(notificationVisibility)).includes(notification.type), diff --git a/src/services/style_setter/style_setter.js b/src/services/style_setter/style_setter.js index a6f22e50b..318978264 100644 --- a/src/services/style_setter/style_setter.js +++ b/src/services/style_setter/style_setter.js @@ -359,7 +359,9 @@ export const getResourcesIndex = async (url, parser = (x) => x) => { const total = [...custom, ...builtin] if (total.length === 0) { - throw new Error(`Resource at ${url} and ${customUrl} completely unavailable. Panicking`) + throw new Error( + `Resource at ${url} and ${customUrl} completely unavailable. Panicking`, + ) } return Object.fromEntries(total) } diff --git a/src/services/sw/sw.js b/src/services/sw/sw.js index 53c7b0cf2..ef8200a4d 100644 --- a/src/services/sw/sw.js +++ b/src/services/sw/sw.js @@ -28,10 +28,8 @@ function getOrCreateServiceWorker() { } function subscribePush(registration, isEnabled, vapidPublicKey) { - if (!isEnabled) - throw new Error('Web Push is disabled in config') - if (!vapidPublicKey) - throw new Error('VAPID public key is not found') + if (!isEnabled) throw new Error('Web Push is disabled in config') + if (!vapidPublicKey) throw new Error('VAPID public key is not found') const subscribeOptions = { userVisibleOnly: false, diff --git a/src/services/theme_data/theme_data_3.service.js b/src/services/theme_data/theme_data_3.service.js index 465062225..694e41e12 100644 --- a/src/services/theme_data/theme_data_3.service.js +++ b/src/services/theme_data/theme_data_3.service.js @@ -262,7 +262,7 @@ export const init = ({ ...r, })), ) - .flat() + .flat(), ...inputRuleset, ].map((rule) => { normalizeCombination(rule)