From 2c20afc04729f157698a51471d47e4b1edd66fff Mon Sep 17 00:00:00 2001 From: resynth1943 Date: Wed, 26 Aug 2020 23:04:56 +0100 Subject: [PATCH 1/2] Fix lodash imports Signed-off-by: resynth1943 --- src/Markdown.js | 2 +- src/SendHistoryManager.js | 2 +- src/autocomplete/CommunityProvider.tsx | 2 +- src/autocomplete/RoomProvider.tsx | 3 ++- src/components/structures/RoomSearch.tsx | 1 - src/components/structures/SearchBox.js | 2 +- .../views/dialogs/secretstorage/AccessSecretStorageDialog.js | 2 +- src/components/views/elements/Field.tsx | 2 +- src/components/views/rooms/Autocomplete.tsx | 2 +- src/emojipicker/recent.ts | 2 +- src/ratelimitedfunc.js | 2 +- src/stores/CustomRoomTagStore.js | 2 +- src/stores/OwnProfileStore.ts | 2 +- src/stores/room-list/filters/NameFilterCondition.ts | 2 +- src/utils/DMRoomMap.js | 2 +- src/utils/ResizeNotifier.js | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/Markdown.js b/src/Markdown.js index e57507b4de..7a573996c3 100644 --- a/src/Markdown.js +++ b/src/Markdown.js @@ -15,7 +15,7 @@ limitations under the License. */ import commonmark from 'commonmark'; -import escape from 'lodash/escape'; +import escape from "lodash/escape"; const ALLOWED_HTML_TAGS = ['sub', 'sup', 'del', 'u']; diff --git a/src/SendHistoryManager.js b/src/SendHistoryManager.js index 794a58ad6f..d38227ae76 100644 --- a/src/SendHistoryManager.js +++ b/src/SendHistoryManager.js @@ -15,7 +15,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import _clamp from 'lodash/clamp'; +import _clamp from "lodash/clamp"; export default class SendHistoryManager { history: Array = []; diff --git a/src/autocomplete/CommunityProvider.tsx b/src/autocomplete/CommunityProvider.tsx index f34fee890e..e2baa29026 100644 --- a/src/autocomplete/CommunityProvider.tsx +++ b/src/autocomplete/CommunityProvider.tsx @@ -23,7 +23,7 @@ import {MatrixClientPeg} from '../MatrixClientPeg'; import QueryMatcher from './QueryMatcher'; import {PillCompletion} from './Components'; import * as sdk from '../index'; -import _sortBy from 'lodash/sortBy'; +import _sortBy from "lodash/sortBy"; import {makeGroupPermalink} from "../utils/permalinks/Permalinks"; import {ICompletion, ISelectionRange} from "./Autocompleter"; import FlairStore from "../stores/FlairStore"; diff --git a/src/autocomplete/RoomProvider.tsx b/src/autocomplete/RoomProvider.tsx index b18b2d132c..30a322d6b1 100644 --- a/src/autocomplete/RoomProvider.tsx +++ b/src/autocomplete/RoomProvider.tsx @@ -27,7 +27,8 @@ import {PillCompletion} from './Components'; import * as sdk from '../index'; import {makeRoomPermalink} from "../utils/permalinks/Permalinks"; import {ICompletion, ISelectionRange} from "./Autocompleter"; -import { uniqBy, sortBy } from 'lodash'; +import uniqBy from "lodash/uniqBy"; +import sortBy from "lodash/sortBy"; const ROOM_REGEX = /\B#\S*/g; diff --git a/src/components/structures/RoomSearch.tsx b/src/components/structures/RoomSearch.tsx index f6b8d42c30..fc8b7a3a12 100644 --- a/src/components/structures/RoomSearch.tsx +++ b/src/components/structures/RoomSearch.tsx @@ -20,7 +20,6 @@ import classNames from "classnames"; import defaultDispatcher from "../../dispatcher/dispatcher"; import { _t } from "../../languageHandler"; import { ActionPayload } from "../../dispatcher/payloads"; -import { throttle } from 'lodash'; import { Key } from "../../Keyboard"; import AccessibleButton from "../views/elements/AccessibleButton"; import { Action } from "../../dispatcher/actions"; diff --git a/src/components/structures/SearchBox.js b/src/components/structures/SearchBox.js index 7e9d290bce..ef0ee38ce6 100644 --- a/src/components/structures/SearchBox.js +++ b/src/components/structures/SearchBox.js @@ -20,7 +20,7 @@ import createReactClass from 'create-react-class'; import PropTypes from 'prop-types'; import { Key } from '../../Keyboard'; import dis from '../../dispatcher/dispatcher'; -import { throttle } from 'lodash'; +import throttle from 'lodash/throttle'; import AccessibleButton from '../../components/views/elements/AccessibleButton'; import classNames from 'classnames'; diff --git a/src/components/views/dialogs/secretstorage/AccessSecretStorageDialog.js b/src/components/views/dialogs/secretstorage/AccessSecretStorageDialog.js index 5c01a6907f..2d556aa597 100644 --- a/src/components/views/dialogs/secretstorage/AccessSecretStorageDialog.js +++ b/src/components/views/dialogs/secretstorage/AccessSecretStorageDialog.js @@ -15,7 +15,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { debounce } from 'lodash'; +import debounce from "lodash/debounce"; import classNames from 'classnames'; import React from 'react'; import PropTypes from "prop-types"; diff --git a/src/components/views/elements/Field.tsx b/src/components/views/elements/Field.tsx index d9fd59dc11..935d452aaa 100644 --- a/src/components/views/elements/Field.tsx +++ b/src/components/views/elements/Field.tsx @@ -17,7 +17,7 @@ limitations under the License. import React, {InputHTMLAttributes, SelectHTMLAttributes, TextareaHTMLAttributes} from 'react'; import classNames from 'classnames'; import * as sdk from '../../../index'; -import { debounce } from 'lodash'; +import debounce from "lodash/debounce"; import {IFieldState, IValidationResult} from "./Validation"; // Invoke validation from user input (when typing, etc.) at most once every N ms. diff --git a/src/components/views/rooms/Autocomplete.tsx b/src/components/views/rooms/Autocomplete.tsx index 70f7556550..8fa623bd91 100644 --- a/src/components/views/rooms/Autocomplete.tsx +++ b/src/components/views/rooms/Autocomplete.tsx @@ -17,7 +17,7 @@ limitations under the License. import React, {createRef, KeyboardEvent} from 'react'; import classNames from 'classnames'; -import flatMap from 'lodash/flatMap'; +import flatMap from "lodash/flatMap"; import {ICompletion, ISelectionRange, IProviderCompletions} from '../../../autocomplete/Autocompleter'; import {Room} from 'matrix-js-sdk/src/models/room'; diff --git a/src/emojipicker/recent.ts b/src/emojipicker/recent.ts index d86aad660d..0f005214a3 100644 --- a/src/emojipicker/recent.ts +++ b/src/emojipicker/recent.ts @@ -16,7 +16,7 @@ limitations under the License. */ import SettingsStore from "../settings/SettingsStore"; -import {orderBy} from "lodash"; +import orderBy from "lodash/orderBy"; import { SettingLevel } from "../settings/SettingLevel"; interface ILegacyFormat { diff --git a/src/ratelimitedfunc.js b/src/ratelimitedfunc.js index 1f15f11d91..691671a086 100644 --- a/src/ratelimitedfunc.js +++ b/src/ratelimitedfunc.js @@ -26,7 +26,7 @@ limitations under the License. * on unmount or similar to cancel any pending update. */ -import { throttle } from "lodash"; +import throttle from "lodash/throttle"; export default function ratelimitedfunc(fn, time) { const throttledFn = throttle(fn, time, { diff --git a/src/stores/CustomRoomTagStore.js b/src/stores/CustomRoomTagStore.js index 39177181b4..ceee67c1e1 100644 --- a/src/stores/CustomRoomTagStore.js +++ b/src/stores/CustomRoomTagStore.js @@ -17,7 +17,7 @@ limitations under the License. import dis from '../dispatcher/dispatcher'; import EventEmitter from 'events'; -import {throttle} from "lodash"; +import throttle from "lodash/throttle"; import SettingsStore from "../settings/SettingsStore"; import RoomListStore, {LISTS_UPDATE_EVENT} from "./room-list/RoomListStore"; import {RoomNotificationStateStore} from "./notifications/RoomNotificationStateStore"; diff --git a/src/stores/OwnProfileStore.ts b/src/stores/OwnProfileStore.ts index 1aa761e1c4..af615b07b6 100644 --- a/src/stores/OwnProfileStore.ts +++ b/src/stores/OwnProfileStore.ts @@ -19,7 +19,7 @@ import { AsyncStoreWithClient } from "./AsyncStoreWithClient"; import defaultDispatcher from "../dispatcher/dispatcher"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { User } from "matrix-js-sdk/src/models/user"; -import { throttle } from "lodash"; +import throttle from "lodash/throttle"; import { MatrixClientPeg } from "../MatrixClientPeg"; import { _t } from "../languageHandler"; diff --git a/src/stores/room-list/filters/NameFilterCondition.ts b/src/stores/room-list/filters/NameFilterCondition.ts index 88edaecfb6..13c75f3d4d 100644 --- a/src/stores/room-list/filters/NameFilterCondition.ts +++ b/src/stores/room-list/filters/NameFilterCondition.ts @@ -18,7 +18,7 @@ import { Room } from "matrix-js-sdk/src/models/room"; import { FILTER_CHANGED, FilterPriority, IFilterCondition } from "./IFilterCondition"; import { EventEmitter } from "events"; import { removeHiddenChars } from "matrix-js-sdk/src/utils"; -import { throttle } from "lodash"; +import throttle from "lodash/throttle"; /** * A filter condition for the room list which reveals rooms of a particular diff --git a/src/utils/DMRoomMap.js b/src/utils/DMRoomMap.js index 6ce92a0458..c6ba0d4d83 100644 --- a/src/utils/DMRoomMap.js +++ b/src/utils/DMRoomMap.js @@ -16,7 +16,7 @@ limitations under the License. */ import {MatrixClientPeg} from '../MatrixClientPeg'; -import _uniq from 'lodash/uniq'; +import _uniq from "lodash/uniq"; import {Room} from "matrix-js-sdk/src/matrix"; /** diff --git a/src/utils/ResizeNotifier.js b/src/utils/ResizeNotifier.js index 5467716576..c43e2c8250 100644 --- a/src/utils/ResizeNotifier.js +++ b/src/utils/ResizeNotifier.js @@ -23,7 +23,7 @@ limitations under the License. * @event module:utils~ResizeNotifier#"middlePanelResizedNoisy" */ import { EventEmitter } from "events"; -import { throttle } from "lodash"; +import throttle from "lodash/throttle"; export default class ResizeNotifier extends EventEmitter { constructor() { From 1fc55b33c1d03423395ad5d149a8796d0fe4f52b Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 28 Aug 2020 18:53:43 +0100 Subject: [PATCH 2/2] Stash lodash import optimization --- src/Markdown.js | 2 +- src/SendHistoryManager.js | 4 ++-- src/autocomplete/CommunityProvider.tsx | 4 ++-- src/autocomplete/EmojiProvider.tsx | 5 ++--- src/autocomplete/QueryMatcher.ts | 7 +++---- src/autocomplete/RoomProvider.tsx | 3 +-- src/autocomplete/UserProvider.tsx | 4 ++-- src/components/structures/SearchBox.js | 2 +- .../dialogs/secretstorage/AccessSecretStorageDialog.js | 2 +- src/components/views/elements/Field.tsx | 2 +- src/components/views/rooms/Autocomplete.tsx | 2 +- src/emojipicker/recent.ts | 2 +- src/ratelimitedfunc.js | 2 +- src/stores/CustomRoomTagStore.js | 2 +- src/stores/OwnProfileStore.ts | 2 +- src/stores/room-list/filters/NameFilterCondition.ts | 2 +- src/utils/DMRoomMap.js | 4 ++-- src/utils/ResizeNotifier.js | 2 +- 18 files changed, 25 insertions(+), 28 deletions(-) diff --git a/src/Markdown.js b/src/Markdown.js index 7a573996c3..492450e87d 100644 --- a/src/Markdown.js +++ b/src/Markdown.js @@ -15,7 +15,7 @@ limitations under the License. */ import commonmark from 'commonmark'; -import escape from "lodash/escape"; +import {escape} from "lodash"; const ALLOWED_HTML_TAGS = ['sub', 'sup', 'del', 'u']; diff --git a/src/SendHistoryManager.js b/src/SendHistoryManager.js index d38227ae76..d9955727a4 100644 --- a/src/SendHistoryManager.js +++ b/src/SendHistoryManager.js @@ -15,7 +15,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import _clamp from "lodash/clamp"; +import {clamp} from "lodash"; export default class SendHistoryManager { history: Array = []; @@ -54,7 +54,7 @@ export default class SendHistoryManager { } getItem(offset: number): ?HistoryItem { - this.currentIndex = _clamp(this.currentIndex + offset, 0, this.history.length - 1); + this.currentIndex = clamp(this.currentIndex + offset, 0, this.history.length - 1); return this.history[this.currentIndex]; } } diff --git a/src/autocomplete/CommunityProvider.tsx b/src/autocomplete/CommunityProvider.tsx index e2baa29026..43217cc1bb 100644 --- a/src/autocomplete/CommunityProvider.tsx +++ b/src/autocomplete/CommunityProvider.tsx @@ -23,7 +23,7 @@ import {MatrixClientPeg} from '../MatrixClientPeg'; import QueryMatcher from './QueryMatcher'; import {PillCompletion} from './Components'; import * as sdk from '../index'; -import _sortBy from "lodash/sortBy"; +import {sortBy} from "lodash"; import {makeGroupPermalink} from "../utils/permalinks/Permalinks"; import {ICompletion, ISelectionRange} from "./Autocompleter"; import FlairStore from "../stores/FlairStore"; @@ -81,7 +81,7 @@ export default class CommunityProvider extends AutocompleteProvider { const matchedString = command[0]; completions = this.matcher.match(matchedString); - completions = _sortBy(completions, [ + completions = sortBy(completions, [ (c) => score(matchedString, c.groupId), (c) => c.groupId.length, ]).map(({avatarUrl, groupId, name}) => ({ diff --git a/src/autocomplete/EmojiProvider.tsx b/src/autocomplete/EmojiProvider.tsx index 147d68f5ff..1ccbc41bd6 100644 --- a/src/autocomplete/EmojiProvider.tsx +++ b/src/autocomplete/EmojiProvider.tsx @@ -23,8 +23,7 @@ import AutocompleteProvider from './AutocompleteProvider'; import QueryMatcher from './QueryMatcher'; import {PillCompletion} from './Components'; import {ICompletion, ISelectionRange} from './Autocompleter'; -import _uniq from 'lodash/uniq'; -import _sortBy from 'lodash/sortBy'; +import {uniq, sortBy} from 'lodash'; import SettingsStore from "../settings/SettingsStore"; import { shortcodeToUnicode } from '../HtmlUtils'; import { EMOJI, IEmoji } from '../emoji'; @@ -115,7 +114,7 @@ export default class EmojiProvider extends AutocompleteProvider { } // Finally, sort by original ordering sorters.push((c) => c._orderBy); - completions = _sortBy(_uniq(completions), sorters); + completions = sortBy(uniq(completions), sorters); completions = completions.map(({shortname}) => { const unicode = shortcodeToUnicode(shortname); diff --git a/src/autocomplete/QueryMatcher.ts b/src/autocomplete/QueryMatcher.ts index 9c91414556..a07ed29c7e 100644 --- a/src/autocomplete/QueryMatcher.ts +++ b/src/autocomplete/QueryMatcher.ts @@ -16,8 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import _at from 'lodash/at'; -import _uniq from 'lodash/uniq'; +import {at, uniq} from 'lodash'; import {removeHiddenChars} from "matrix-js-sdk/src/utils"; interface IOptions { @@ -73,7 +72,7 @@ export default class QueryMatcher { // type for their values. We assume that those values who's keys have // been specified will be string. Also, we cannot infer all the // types of the keys of the objects at compile. - const keyValues = _at(object, this._options.keys); + const keyValues = at(object, this._options.keys); if (this._options.funcs) { for (const f of this._options.funcs) { @@ -137,7 +136,7 @@ export default class QueryMatcher { }); // Now map the keys to the result objects. Also remove any duplicates. - return _uniq(matches.map((match) => match.object)); + return uniq(matches.map((match) => match.object)); } private processQuery(query: string): string { diff --git a/src/autocomplete/RoomProvider.tsx b/src/autocomplete/RoomProvider.tsx index 30a322d6b1..de16e68e01 100644 --- a/src/autocomplete/RoomProvider.tsx +++ b/src/autocomplete/RoomProvider.tsx @@ -27,8 +27,7 @@ import {PillCompletion} from './Components'; import * as sdk from '../index'; import {makeRoomPermalink} from "../utils/permalinks/Permalinks"; import {ICompletion, ISelectionRange} from "./Autocompleter"; -import uniqBy from "lodash/uniqBy"; -import sortBy from "lodash/sortBy"; +import {uniqBy, sortBy} from "lodash"; const ROOM_REGEX = /\B#\S*/g; diff --git a/src/autocomplete/UserProvider.tsx b/src/autocomplete/UserProvider.tsx index c957b5e597..d592421ef2 100644 --- a/src/autocomplete/UserProvider.tsx +++ b/src/autocomplete/UserProvider.tsx @@ -23,7 +23,7 @@ import AutocompleteProvider from './AutocompleteProvider'; import {PillCompletion} from './Components'; import * as sdk from '../index'; import QueryMatcher from './QueryMatcher'; -import _sortBy from 'lodash/sortBy'; +import {sortBy} from 'lodash'; import {MatrixClientPeg} from '../MatrixClientPeg'; import MatrixEvent from "matrix-js-sdk/src/models/event"; @@ -151,7 +151,7 @@ export default class UserProvider extends AutocompleteProvider { const currentUserId = MatrixClientPeg.get().credentials.userId; this.users = this.room.getJoinedMembers().filter(({userId}) => userId !== currentUserId); - this.users = _sortBy(this.users, (member) => 1E20 - lastSpoken[member.userId] || 1E20); + this.users = sortBy(this.users, (member) => 1E20 - lastSpoken[member.userId] || 1E20); this.matcher.setObjects(this.users); } diff --git a/src/components/structures/SearchBox.js b/src/components/structures/SearchBox.js index ef0ee38ce6..e4befee863 100644 --- a/src/components/structures/SearchBox.js +++ b/src/components/structures/SearchBox.js @@ -20,7 +20,7 @@ import createReactClass from 'create-react-class'; import PropTypes from 'prop-types'; import { Key } from '../../Keyboard'; import dis from '../../dispatcher/dispatcher'; -import throttle from 'lodash/throttle'; +import {throttle} from 'lodash'; import AccessibleButton from '../../components/views/elements/AccessibleButton'; import classNames from 'classnames'; diff --git a/src/components/views/dialogs/secretstorage/AccessSecretStorageDialog.js b/src/components/views/dialogs/secretstorage/AccessSecretStorageDialog.js index 2d556aa597..85ace249a3 100644 --- a/src/components/views/dialogs/secretstorage/AccessSecretStorageDialog.js +++ b/src/components/views/dialogs/secretstorage/AccessSecretStorageDialog.js @@ -15,7 +15,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import debounce from "lodash/debounce"; +import {debounce} from "lodash"; import classNames from 'classnames'; import React from 'react'; import PropTypes from "prop-types"; diff --git a/src/components/views/elements/Field.tsx b/src/components/views/elements/Field.tsx index 935d452aaa..8c4e6aed31 100644 --- a/src/components/views/elements/Field.tsx +++ b/src/components/views/elements/Field.tsx @@ -17,7 +17,7 @@ limitations under the License. import React, {InputHTMLAttributes, SelectHTMLAttributes, TextareaHTMLAttributes} from 'react'; import classNames from 'classnames'; import * as sdk from '../../../index'; -import debounce from "lodash/debounce"; +import {debounce} from "lodash"; import {IFieldState, IValidationResult} from "./Validation"; // Invoke validation from user input (when typing, etc.) at most once every N ms. diff --git a/src/components/views/rooms/Autocomplete.tsx b/src/components/views/rooms/Autocomplete.tsx index 8fa623bd91..15af75084a 100644 --- a/src/components/views/rooms/Autocomplete.tsx +++ b/src/components/views/rooms/Autocomplete.tsx @@ -17,7 +17,7 @@ limitations under the License. import React, {createRef, KeyboardEvent} from 'react'; import classNames from 'classnames'; -import flatMap from "lodash/flatMap"; +import {flatMap} from "lodash"; import {ICompletion, ISelectionRange, IProviderCompletions} from '../../../autocomplete/Autocompleter'; import {Room} from 'matrix-js-sdk/src/models/room'; diff --git a/src/emojipicker/recent.ts b/src/emojipicker/recent.ts index 0f005214a3..d86aad660d 100644 --- a/src/emojipicker/recent.ts +++ b/src/emojipicker/recent.ts @@ -16,7 +16,7 @@ limitations under the License. */ import SettingsStore from "../settings/SettingsStore"; -import orderBy from "lodash/orderBy"; +import {orderBy} from "lodash"; import { SettingLevel } from "../settings/SettingLevel"; interface ILegacyFormat { diff --git a/src/ratelimitedfunc.js b/src/ratelimitedfunc.js index 691671a086..3df3db615e 100644 --- a/src/ratelimitedfunc.js +++ b/src/ratelimitedfunc.js @@ -26,7 +26,7 @@ limitations under the License. * on unmount or similar to cancel any pending update. */ -import throttle from "lodash/throttle"; +import {throttle} from "lodash"; export default function ratelimitedfunc(fn, time) { const throttledFn = throttle(fn, time, { diff --git a/src/stores/CustomRoomTagStore.js b/src/stores/CustomRoomTagStore.js index ceee67c1e1..39177181b4 100644 --- a/src/stores/CustomRoomTagStore.js +++ b/src/stores/CustomRoomTagStore.js @@ -17,7 +17,7 @@ limitations under the License. import dis from '../dispatcher/dispatcher'; import EventEmitter from 'events'; -import throttle from "lodash/throttle"; +import {throttle} from "lodash"; import SettingsStore from "../settings/SettingsStore"; import RoomListStore, {LISTS_UPDATE_EVENT} from "./room-list/RoomListStore"; import {RoomNotificationStateStore} from "./notifications/RoomNotificationStateStore"; diff --git a/src/stores/OwnProfileStore.ts b/src/stores/OwnProfileStore.ts index af615b07b6..1aa761e1c4 100644 --- a/src/stores/OwnProfileStore.ts +++ b/src/stores/OwnProfileStore.ts @@ -19,7 +19,7 @@ import { AsyncStoreWithClient } from "./AsyncStoreWithClient"; import defaultDispatcher from "../dispatcher/dispatcher"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { User } from "matrix-js-sdk/src/models/user"; -import throttle from "lodash/throttle"; +import { throttle } from "lodash"; import { MatrixClientPeg } from "../MatrixClientPeg"; import { _t } from "../languageHandler"; diff --git a/src/stores/room-list/filters/NameFilterCondition.ts b/src/stores/room-list/filters/NameFilterCondition.ts index 13c75f3d4d..88edaecfb6 100644 --- a/src/stores/room-list/filters/NameFilterCondition.ts +++ b/src/stores/room-list/filters/NameFilterCondition.ts @@ -18,7 +18,7 @@ import { Room } from "matrix-js-sdk/src/models/room"; import { FILTER_CHANGED, FilterPriority, IFilterCondition } from "./IFilterCondition"; import { EventEmitter } from "events"; import { removeHiddenChars } from "matrix-js-sdk/src/utils"; -import throttle from "lodash/throttle"; +import { throttle } from "lodash"; /** * A filter condition for the room list which reveals rooms of a particular diff --git a/src/utils/DMRoomMap.js b/src/utils/DMRoomMap.js index c6ba0d4d83..4e219b1611 100644 --- a/src/utils/DMRoomMap.js +++ b/src/utils/DMRoomMap.js @@ -16,7 +16,7 @@ limitations under the License. */ import {MatrixClientPeg} from '../MatrixClientPeg'; -import _uniq from "lodash/uniq"; +import {uniq} from "lodash"; import {Room} from "matrix-js-sdk/src/matrix"; /** @@ -111,7 +111,7 @@ export default class DMRoomMap { userToRooms[userId] = [roomId]; } else { roomIds.push(roomId); - userToRooms[userId] = _uniq(roomIds); + userToRooms[userId] = uniq(roomIds); } }); return true; diff --git a/src/utils/ResizeNotifier.js b/src/utils/ResizeNotifier.js index c43e2c8250..5467716576 100644 --- a/src/utils/ResizeNotifier.js +++ b/src/utils/ResizeNotifier.js @@ -23,7 +23,7 @@ limitations under the License. * @event module:utils~ResizeNotifier#"middlePanelResizedNoisy" */ import { EventEmitter } from "events"; -import throttle from "lodash/throttle"; +import { throttle } from "lodash"; export default class ResizeNotifier extends EventEmitter { constructor() {