From 00d79487cd89f3cae675ecc0392c47ba547b69a5 Mon Sep 17 00:00:00 2001 From: Aya Morisawa Date: Fri, 7 Sep 2018 00:02:55 +0900 Subject: [PATCH] Add erase function (#2641) --- .../app/common/scripts/streaming/stream-manager.ts | 3 ++- src/client/app/common/views/components/poll-editor.vue | 3 ++- src/client/app/desktop/views/components/post-form.vue | 3 ++- src/client/app/mios.ts | 3 ++- src/client/app/mobile/views/components/post-form.vue | 3 ++- src/client/app/store.ts | 7 ++++--- src/client/app/sw.js | 4 ++-- src/prelude/array.ts | 4 ++++ src/server/api/endpoints/hashtags/trend.ts | 4 ++-- src/server/api/endpoints/notes/search_by_tag.ts | 9 +++++---- src/services/note/create.ts | 7 ++++--- 11 files changed, 31 insertions(+), 19 deletions(-) diff --git a/src/client/app/common/scripts/streaming/stream-manager.ts b/src/client/app/common/scripts/streaming/stream-manager.ts index 568b8b037..8dd06f67d 100644 --- a/src/client/app/common/scripts/streaming/stream-manager.ts +++ b/src/client/app/common/scripts/streaming/stream-manager.ts @@ -1,6 +1,7 @@ import { EventEmitter } from 'eventemitter3'; import * as uuid from 'uuid'; import Connection from './stream'; +import { erase } from '../../../../../prelude/array'; /** * ストリーム接続を管理するクラス @@ -89,7 +90,7 @@ export default abstract class StreamManager extends EventE * @param userId use で発行したユーザーID */ public dispose(userId) { - this.users = this.users.filter(id => id != userId); + this.users = erase(userId, this.users); this._connection.user = `Managed (${ this.users.length })`; diff --git a/src/client/app/common/views/components/poll-editor.vue b/src/client/app/common/views/components/poll-editor.vue index 115c934c8..30d9799fe 100644 --- a/src/client/app/common/views/components/poll-editor.vue +++ b/src/client/app/common/views/components/poll-editor.vue @@ -20,6 +20,7 @@