refactor: PackedHoge型をPacked<'Hoge'>型に書き換える (#7792)
* packedNotificationSchemaを更新 * read:gallery, write:gallery, read:gallery-likes, write:gallery-likesに翻訳を追加 * fix * add header, choice, invitation * test * fix * yatta * remove no longer needed "as PackedUser/PackedNote" * clean up * add simple-schema * fix lint * define items in full Schema * revert https://github.com/misskey-dev/misskey/pull/7772#discussion_r706627736 * user packとnote packの型不整合を修正 * add prelude/types.ts * emoji * signin * game * matching * fix * add emoji schema * add reversiGame * add reversiMatching * remove signin schema (use Signin entity) * add Packed type * note-reaction * user * user-group * user-list * note * app, messaging-message * notification * drive-file * drive-folder * following * muting * blocking * hashtag * page * app (with modifying schema) * import user? * channel * antenna * clip * gallery-post * emoji * Packed * reversi-matching * add changelog * add changelog * revert fix
This commit is contained in:
@@ -14,7 +14,7 @@ import { AccessToken } from '@/models/entities/access-token';
|
||||
import { UserProfile } from '@/models/entities/user-profile';
|
||||
import { publishChannelStream, publishGroupMessagingStream, publishMessagingStream } from '@/services/stream';
|
||||
import { UserGroup } from '@/models/entities/user-group';
|
||||
import { PackedNote } from '@/models/repositories/note';
|
||||
import { Packed } from '@/misc/schema';
|
||||
|
||||
/**
|
||||
* Main stream connection
|
||||
@@ -31,7 +31,7 @@ export default class Connection {
|
||||
public subscriber: EventEmitter;
|
||||
private channels: Channel[] = [];
|
||||
private subscribingNotes: any = {};
|
||||
private cachedNotes: PackedNote[] = [];
|
||||
private cachedNotes: Packed<'Note'>[] = [];
|
||||
|
||||
constructor(
|
||||
wsConnection: websocket.connection,
|
||||
@@ -150,8 +150,8 @@ export default class Connection {
|
||||
}
|
||||
|
||||
@autobind
|
||||
public cacheNote(note: PackedNote) {
|
||||
const add = (note: PackedNote) => {
|
||||
public cacheNote(note: Packed<'Note'>) {
|
||||
const add = (note: Packed<'Note'>) => {
|
||||
const existIndex = this.cachedNotes.findIndex(n => n.id === note.id);
|
||||
if (existIndex > -1) {
|
||||
this.cachedNotes[existIndex] = note;
|
||||
|
Reference in New Issue
Block a user