diff options
author | Joram Wilander <jwawilander@gmail.com> | 2017-06-18 14:42:32 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-18 14:42:32 -0400 |
commit | ab67f6e257f6e8f08145a02a7b93550f99641be4 (patch) | |
tree | d33d1c58a3d229f7e37db58bc2c397ac3806c503 /webapp/stores/file_store.jsx | |
parent | 0231e95f1c5a8c42ba97875f0d2301815f552974 (diff) | |
download | chat-ab67f6e257f6e8f08145a02a7b93550f99641be4.tar.gz chat-ab67f6e257f6e8f08145a02a7b93550f99641be4.tar.bz2 chat-ab67f6e257f6e8f08145a02a7b93550f99641be4.zip |
PLT-6215 Major post list refactor (#6501)
* Major post list refactor
* Fix post and thread deletion
* Fix preferences not selecting correctly
* Fix military time displaying
* Fix UP key for editing posts
* Fix ESLint error
* Various fixes and updates per feedback
* Fix for permalink view
* Revert to old scrolling method and various fixes
* Add floating timestamp, new message indicator, scroll arrows
* Update post loading for focus mode and add visibility limit
* Fix pinning posts and a react warning
* Add loading UI updates from Asaad
* Fix refreshing loop
* Temporarily bump post visibility limit
* Update infinite scrolling
* Remove infinite scrolling
Diffstat (limited to 'webapp/stores/file_store.jsx')
-rw-r--r-- | webapp/stores/file_store.jsx | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/webapp/stores/file_store.jsx b/webapp/stores/file_store.jsx deleted file mode 100644 index 34378c062..000000000 --- a/webapp/stores/file_store.jsx +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -import AppDispatcher from '../dispatcher/app_dispatcher.jsx'; -import Constants from 'utils/constants.jsx'; -import EventEmitter from 'events'; - -const ActionTypes = Constants.ActionTypes; - -const CHANGE_EVENT = 'changed'; - -class FileStore extends EventEmitter { - constructor() { - super(); - - this.handleEventPayload = this.handleEventPayload.bind(this); - this.dispatchToken = AppDispatcher.register(this.handleEventPayload); - - this.setMaxListeners(600); - - this.fileInfosByPost = new Map(); - } - - addChangeListener(callback) { - this.on(CHANGE_EVENT, callback); - } - - removeChangeListener(callback) { - this.removeListener(CHANGE_EVENT, callback); - } - - emitChange() { - this.emit(CHANGE_EVENT); - } - - hasInfosForPost(postId) { - return this.fileInfosByPost.has(postId); - } - - getInfosForPost(postId) { - return this.fileInfosByPost.get(postId); - } - - saveInfos(postId, infos) { - this.fileInfosByPost.set(postId, infos); - } - - getFileUrl(fileId) { - return `/api/v3/files/${fileId}/get`; - } - - getFileThumbnailUrl(fileId) { - return `/api/v3/files/${fileId}/get_thumbnail`; - } - - getFilePreviewUrl(fileId) { - return `/api/v3/files/${fileId}/get_preview`; - } - - handleEventPayload(payload) { - const action = payload.action; - - switch (action.type) { - case ActionTypes.RECEIVED_FILE_INFOS: - // This assumes that all received file infos are for a single post - this.saveInfos(action.postId, action.infos); - this.emitChange(action.postId); - break; - } - } -} - -export default new FileStore(); |