From 88508c459cf81ad397e8ebe66f29d4ba66d73d2d Mon Sep 17 00:00:00 2001 From: Alexander Skvortsov Date: Fri, 2 Oct 2020 20:49:17 -0400 Subject: [PATCH] Use Stream util instead of m.stream --- .../tags/js/src/admin/components/EditTagModal.js | 15 ++++++++------- .../js/src/forum/components/TagDiscussionModal.js | 3 ++- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/extensions/tags/js/src/admin/components/EditTagModal.js b/extensions/tags/js/src/admin/components/EditTagModal.js index 2475861eb..ba1ce1968 100644 --- a/extensions/tags/js/src/admin/components/EditTagModal.js +++ b/extensions/tags/js/src/admin/components/EditTagModal.js @@ -2,6 +2,7 @@ import Modal from 'flarum/components/Modal'; import Button from 'flarum/components/Button'; import ItemList from 'flarum/utils/ItemList'; import { slug } from 'flarum/utils/string'; +import Stream from 'flarum/utils/Stream'; import tagLabel from '../../common/helpers/tagLabel'; @@ -15,12 +16,12 @@ export default class EditTagModal extends Modal { this.tag = this.attrs.model || app.store.createRecord('tags'); - this.name = m.stream(this.tag.name() || ''); - this.slug = m.stream(this.tag.slug() || ''); - this.description = m.stream(this.tag.description() || ''); - this.color = m.stream(this.tag.color() || ''); - this.icon = m.stream(this.tag.icon() || ''); - this.isHidden = m.stream(this.tag.isHidden() || false); + this.name = Stream(this.tag.name() || ''); + this.slug = Stream(this.tag.slug() || ''); + this.description = Stream(this.tag.description() || ''); + this.color = Stream(this.tag.color() || ''); + this.icon = Stream(this.tag.icon() || ''); + this.isHidden = Stream(this.tag.isHidden() || false); } className() { @@ -122,7 +123,7 @@ export default class EditTagModal extends Modal { this.loading = true; - // Errors aren't passed to the modal onerror handler here. + // Errors aren't passed to the modal onerror handler here. // This is done for better error visibility on smaller screen heights. this.tag.save(this.submitData()).then( () => this.hide(), diff --git a/extensions/tags/js/src/forum/components/TagDiscussionModal.js b/extensions/tags/js/src/forum/components/TagDiscussionModal.js index 326cb940f..e043613d3 100644 --- a/extensions/tags/js/src/forum/components/TagDiscussionModal.js +++ b/extensions/tags/js/src/forum/components/TagDiscussionModal.js @@ -5,6 +5,7 @@ import highlight from 'flarum/helpers/highlight'; import classList from 'flarum/utils/classList'; import extractText from 'flarum/utils/extractText'; import KeyboardNavigatable from 'flarum/utils/KeyboardNavigatable'; +import Stream from 'flarum/utils/Stream'; import tagLabel from '../../common/helpers/tagLabel'; import tagIcon from '../../common/helpers/tagIcon'; @@ -25,7 +26,7 @@ export default class TagDiscussionModal extends Modal { this.tags = sortTags(this.tags); this.selected = []; - this.filter = m.stream(''); + this.filter = Stream(''); this.index = this.tags[0].id(); this.focused = false;