cleaned up lodash imports

This commit is contained in:
Henry Jameson 2026-06-03 01:56:18 +03:00
commit 1ee18a7fa3
15 changed files with 19 additions and 27 deletions

View file

@ -1,4 +1,4 @@
import _ from 'lodash'
import { throttle } from 'lodash'
import { mapState as mapPiniaState } from 'pinia'
import { mapGetters, mapState } from 'vuex'
@ -224,7 +224,7 @@ const Chat = {
}
}, 5000)
},
handleScroll: _.throttle(function () {
handleScroll: throttle(function () {
this.lastScrollPosition = getScrollPosition()
if (!this.currentChat) {
return

View file

@ -1,4 +1,4 @@
import get from 'lodash/get'
import { get } from 'lodash'
import { defineAsyncComponent } from 'vue'
import Modal from '../modal/modal.vue'

View file

@ -1,4 +1,4 @@
import get from 'lodash/get'
import { get } from 'lodash'
import { defineAsyncComponent } from 'vue'
import Modal from '../modal/modal.vue'

View file

@ -1,5 +1,4 @@
import { uniqBy } from 'lodash'
import map from 'lodash/map'
import { uniqBy, map } from 'lodash'
import TabSwitcher from 'src/components/tab_switcher/tab_switcher.jsx'
import Conversation from '../conversation/conversation.vue'

View file

@ -1,6 +1,4 @@
import get from 'lodash/get'
import map from 'lodash/map'
import reject from 'lodash/reject'
import { get, map, reject } from 'lodash'
import withLoadMore from 'src/components/../hocs/with_load_more/with_load_more'
import withSubscription from 'src/components/../hocs/with_subscription/with_subscription'

View file

@ -1,5 +1,4 @@
import groupBy from 'lodash/groupBy'
import map from 'lodash/map'
import { map, groupBy } from 'lodash'
import { mapGetters, mapState } from 'vuex'
import BasicUserCard from '../basic_user_card/basic_user_card.vue'

View file

@ -1,7 +1,4 @@
import ldEscape from 'lodash/escape'
import isEqual from 'lodash/isEqual'
import merge from 'lodash/merge'
import ldUnescape from 'lodash/unescape'
import { escape as ldEscape, isEqual, merge, unescape as ldUnescape } from 'lodash'
import { mapState } from 'pinia'
import Checkbox from 'src/components/checkbox/checkbox.vue'

View file

@ -1,4 +1,4 @@
import get from 'lodash/get'
import { get } from 'lodash'
import { mapState } from 'pinia'
import RichContent from 'src/components/rich_content/rich_content.jsx'

View file

@ -1,6 +1,6 @@
// eslint-disable-next-line no-unused
import isEmpty from 'lodash/isEmpty'
import { isEmpty } from 'lodash'
import { h } from 'vue'
import { getComponentProps } from '../../services/component_utils/component_utils'

View file

@ -1,6 +1,6 @@
// eslint-disable-next-line no-unused
import isEmpty from 'lodash/isEmpty'
import { isEmpty } from 'lodash'
import { h } from 'vue'
import { getComponentProps } from '../../services/component_utils/component_utils'

View file

@ -1,5 +1,4 @@
import { cloneDeep, each, get, set } from 'lodash'
import merge from 'lodash.merge'
import { cloneDeep, each, get, set, merge } from 'lodash'
import { storage } from './storage.js'

View file

@ -1,4 +1,4 @@
import _ from 'lodash'
import { maxBy, minBy } from 'lodash'
const empty = (chatId) => {
return {
@ -42,12 +42,12 @@ const deleteMessage = (storage, messageId) => {
delete storage.idIndex[messageId]
if (storage.maxId === messageId) {
const lastMessage = _.maxBy(storage.messages, 'id')
const lastMessage = maxBy(storage.messages, 'id')
storage.maxId = lastMessage.id
}
if (storage.minId === messageId) {
const firstMessage = _.minBy(storage.messages, 'id')
const firstMessage = minBy(storage.messages, 'id')
storage.minId = firstMessage.id
}
}

View file

@ -1,4 +1,4 @@
import isFunction from 'lodash/isFunction'
import { isFunction } from 'lodash'
const getComponentOptions = (Component) =>
isFunction(Component) ? Component.options : Component

View file

@ -1,5 +1,5 @@
import ISO6391 from 'iso-639-1'
import _ from 'lodash'
import { map } from 'lodash'
import languagesObject from '../../i18n/messages'
@ -35,7 +35,7 @@ const getLanguageName = (code) => {
)
}
const languages = _.map(languagesObject.languages, (code) => ({
const languages = map(languagesObject.languages, (code) => ({
code,
name: getLanguageName(code),
})).sort((a, b) => a.name.localeCompare(b.name))

View file

@ -1,4 +1,4 @@
import filter from 'lodash/filter'
import { filter } from 'lodash'
import { defineStore } from 'pinia'
import { useInterfaceStore } from 'src/stores/interface.js'