From 60ef3e3563c95008bde52818a7d638d1d8ff9b19 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 9 Nov 2018 08:13:34 +0900 Subject: Refactor & Clean up --- src/client/app/common/scripts/note-mixin.ts | 12 ++++++------ src/client/app/common/scripts/note-subscriber.ts | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/client/app/common/scripts') diff --git a/src/client/app/common/scripts/note-mixin.ts b/src/client/app/common/scripts/note-mixin.ts index cd3d3ae760..93debf81e8 100644 --- a/src/client/app/common/scripts/note-mixin.ts +++ b/src/client/app/common/scripts/note-mixin.ts @@ -115,7 +115,7 @@ export default (opts: Opts = {}) => ({ react(viaKeyboard = false) { this.blur(); - (this as any).os.new(MkReactionPicker, { + this.$root.new(MkReactionPicker, { source: this.$refs.reactButton, note: this.appearNote, showFocus: viaKeyboard, @@ -126,28 +126,28 @@ export default (opts: Opts = {}) => ({ }, reactDirectly(reaction) { - (this as any).api('notes/reactions/create', { + (this.$root.api('notes/reactions/create', { noteId: this.appearNote.id, reaction: reaction }); }, favorite() { - (this as any).api('notes/favorites/create', { + this.$root.api('notes/favorites/create', { noteId: this.appearNote.id }).then(() => { - (this as any).os.new(Ok); + this.$root.new(Ok); }); }, del() { - (this as any).api('notes/delete', { + this.$root.api('notes/delete', { noteId: this.appearNote.id }); }, menu(viaKeyboard = false) { - (this as any).os.new(MkNoteMenu, { + this.$root.new(MkNoteMenu, { source: this.$refs.menuButton, note: this.appearNote, animation: !viaKeyboard, diff --git a/src/client/app/common/scripts/note-subscriber.ts b/src/client/app/common/scripts/note-subscriber.ts index 1a82dd3918..bc434c4360 100644 --- a/src/client/app/common/scripts/note-subscriber.ts +++ b/src/client/app/common/scripts/note-subscriber.ts @@ -26,7 +26,7 @@ export default prop => ({ created() { if (this.$store.getters.isSignedIn) { - this.connection = (this as any).os.stream; + this.connection = this.$root.stream; } }, -- cgit v1.2.3-freya