diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-10-09 15:08:31 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-10-09 15:08:31 +0900 |
| commit | 136b13e7ca2163f37ee81a8981f0b2205e7303c9 (patch) | |
| tree | 1f92e693afe46ee6ab7327814eaa386edce92b6a /src/client/app/common/scripts | |
| parent | :art: (diff) | |
| download | sharkey-136b13e7ca2163f37ee81a8981f0b2205e7303c9.tar.gz sharkey-136b13e7ca2163f37ee81a8981f0b2205e7303c9.tar.bz2 sharkey-136b13e7ca2163f37ee81a8981f0b2205e7303c9.zip | |
Fix bug and refactor
Diffstat (limited to 'src/client/app/common/scripts')
| -rw-r--r-- | src/client/app/common/scripts/stream.ts | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/src/client/app/common/scripts/stream.ts b/src/client/app/common/scripts/stream.ts index e95306183e..98a7efaa4c 100644 --- a/src/client/app/common/scripts/stream.ts +++ b/src/client/app/common/scripts/stream.ts @@ -26,92 +26,6 @@ export default class Stream extends EventEmitter { this.stream.addEventListener('open', this.onOpen); this.stream.addEventListener('close', this.onClose); this.stream.addEventListener('message', this.onMessage); - - if (user) { - const main = this.useSharedConnection('main'); - - // 自分の情報が更新されたとき - main.on('meUpdated', i => { - os.store.dispatch('mergeMe', i); - }); - - main.on('readAllNotifications', () => { - os.store.dispatch('mergeMe', { - hasUnreadNotification: false - }); - }); - - main.on('unreadNotification', () => { - os.store.dispatch('mergeMe', { - hasUnreadNotification: true - }); - }); - - main.on('readAllMessagingMessages', () => { - os.store.dispatch('mergeMe', { - hasUnreadMessagingMessage: false - }); - }); - - main.on('unreadMessagingMessage', () => { - os.store.dispatch('mergeMe', { - hasUnreadMessagingMessage: true - }); - }); - - main.on('unreadMention', () => { - os.store.dispatch('mergeMe', { - hasUnreadMentions: true - }); - }); - - main.on('readAllUnreadMentions', () => { - os.store.dispatch('mergeMe', { - hasUnreadMentions: false - }); - }); - - main.on('unreadSpecifiedNote', () => { - os.store.dispatch('mergeMe', { - hasUnreadSpecifiedNotes: true - }); - }); - - main.on('readAllUnreadSpecifiedNotes', () => { - os.store.dispatch('mergeMe', { - hasUnreadSpecifiedNotes: false - }); - }); - - main.on('clientSettingUpdated', x => { - os.store.commit('settings/set', { - key: x.key, - value: x.value - }); - }); - - main.on('homeUpdated', x => { - os.store.commit('settings/setHome', x); - }); - - main.on('mobileHomeUpdated', x => { - os.store.commit('settings/setMobileHome', x); - }); - - main.on('widgetUpdated', x => { - os.store.commit('settings/setWidget', { - id: x.id, - data: x.data - }); - }); - - // トークンが再生成されたとき - // このままではMisskeyが利用できないので強制的にサインアウトさせる - main.on('myTokenRegenerated', () => { - alert('%i18n:common.my-token-regenerated%'); - os.signout(); - }); - } } public useSharedConnection = (channel: string): SharedConnection => { |