From 3c5cf3e778c61722bdaaa00841cc31a9031ce3d1 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 21 Aug 2019 15:34:49 +0200 Subject: [PATCH] rename ComposerHistoryManager to SendHistoryManager to avoid confusion ...with the undo history manager for the composer. --- src/{ComposerHistoryManager.js => SendHistoryManager.js} | 2 +- src/components/views/rooms/SendMessageComposer.js | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) rename src/{ComposerHistoryManager.js => SendHistoryManager.js} (97%) diff --git a/src/ComposerHistoryManager.js b/src/SendHistoryManager.js similarity index 97% rename from src/ComposerHistoryManager.js rename to src/SendHistoryManager.js index 33030ed6cf..c838f1246b 100644 --- a/src/ComposerHistoryManager.js +++ b/src/SendHistoryManager.js @@ -17,7 +17,7 @@ limitations under the License. import _clamp from 'lodash/clamp'; -export default class ComposerHistoryManager { +export default class SendHistoryManager { history: Array = []; prefix: string; lastIndex: number = 0; // used for indexing the storage diff --git a/src/components/views/rooms/SendMessageComposer.js b/src/components/views/rooms/SendMessageComposer.js index da858e9029..0d1d24c282 100644 --- a/src/components/views/rooms/SendMessageComposer.js +++ b/src/components/views/rooms/SendMessageComposer.js @@ -18,7 +18,6 @@ import React from 'react'; import PropTypes from 'prop-types'; import dis from '../../../dispatcher'; import EditorModel from '../../../editor/model'; -import {getCaretOffsetAndText} from '../../../editor/dom'; import {htmlSerializeIfNeeded, textSerialize, containsEmote, stripEmoteCommand} from '../../../editor/serialize'; import {CommandPartCreator} from '../../../editor/parts'; import {MatrixClient} from 'matrix-js-sdk'; @@ -28,7 +27,7 @@ import RoomViewStore from '../../../stores/RoomViewStore'; import ReplyThread from "../elements/ReplyThread"; import {parseEvent} from '../../../editor/deserialize'; import {findEditableEvent} from '../../../utils/EventUtils'; -import ComposerHistoryManager from "../../../ComposerHistoryManager"; +import SendHistoryManager from "../../../SendHistoryManager"; import {processCommandInput} from '../../../SlashCommands'; import sdk from '../../../index'; import Modal from '../../../Modal'; @@ -234,7 +233,7 @@ export default class SendMessageComposer extends React.Component { const partCreator = new CommandPartCreator(this.props.room, this.context.matrixClient); this.model = new EditorModel([], partCreator); this.dispatcherRef = dis.register(this.onAction); - this.sendHistoryManager = new ComposerHistoryManager(this.props.room.roomId, 'mx_slate_composer_history_'); + this.sendHistoryManager = new SendHistoryManager(this.props.room.roomId, 'mx_slate_composer_history_'); } onAction = (payload) => {