diff --git a/shared/js/events.ts b/shared/js/events.ts index 978fe79e..ba77409c 100644 --- a/shared/js/events.ts +++ b/shared/js/events.ts @@ -128,7 +128,7 @@ export class Registry implements EventReceiver { (this.connections[null as any] || (this.connections[null as any] = [])).push(target as any); } - connect(events: T | T[], target: EventReceiver) { + connect(events: T | T[], target: EventReceiver) { for(const event of Array.isArray(events) ? events : [events]) (this.connections[event as string] || (this.connections[event as string] = [])).push(target as any); } @@ -138,10 +138,10 @@ export class Registry implements EventReceiver { (this.connections[event as string] || []).remove(target as any); } - disconnectAll(target: EventReceiver) { - this.connections[null as any]?.remove(target); + disconnectAll(target: EventReceiver) { + this.connections[null as any]?.remove(target as any); for(const event of Object.keys(this.connections)) - this.connections[event].remove(target); + this.connections[event].remove(target as any); } fire(event_type: T, data?: Events[T], overrideTypeKey?: boolean) { diff --git a/shared/js/ipc/MethodProxy.ts b/shared/js/ipc/MethodProxy.ts index cd803921..b1fb9c5e 100644 --- a/shared/js/ipc/MethodProxy.ts +++ b/shared/js/ipc/MethodProxy.ts @@ -1,6 +1,7 @@ import * as log from "tc-shared/log"; import {LogCategory} from "tc-shared/log"; import {BasicIPCHandler, IPCChannel, ChannelMessage} from "tc-shared/ipc/BrowserIPC"; +import {guid} from "tc-shared/crypto/uid"; export interface MethodProxyInvokeData { method_name: string; @@ -96,7 +97,7 @@ export abstract class MethodProxy { return Promise.reject("not connected"); const proxy_callback = { - promise_id: uuidv4() + promise_id: guid() } as MethodProxyCallback; this._proxied_callbacks[proxy_callback.promise_id] = proxy_callback; proxy_callback.promise = new Promise((resolve, reject) => { diff --git a/shared/js/ui/frames/side/music_info.ts b/shared/js/ui/frames/side/music_info.ts index 5a793f59..fe80a958 100644 --- a/shared/js/ui/frames/side/music_info.ts +++ b/shared/js/ui/frames/side/music_info.ts @@ -386,9 +386,16 @@ export class MusicInfo { event.new.events.on("music_status_update", callback_time_update); event.new.events.on("music_song_change", callback_song_change); + // @ts-ignore event.new.events.connect("playlist_song_add", this.events); + + // @ts-ignore event.new.events.connect("playlist_song_remove", this.events); + + // @ts-ignore event.new.events.connect("playlist_song_reorder", this.events); + + // @ts-ignore event.new.events.connect("playlist_song_loaded", this.events); } }); diff --git a/shared/js/ui/modal/ModalChangeVolumeNew.tsx b/shared/js/ui/modal/ModalChangeVolumeNew.tsx index e3b72189..56b698fb 100644 --- a/shared/js/ui/modal/ModalChangeVolumeNew.tsx +++ b/shared/js/ui/modal/ModalChangeVolumeNew.tsx @@ -239,6 +239,10 @@ export function spawnClientVolumeChange(client: ClientEntry) { }); const modal = spawnReactModal(class extends Modal { + constructor() { + super(); + } + renderBody() { return ; } @@ -274,6 +278,10 @@ export function spawnMusicBotVolumeChange(client: MusicClientEntry, maxValue: nu }); const modal = spawnReactModal(class extends Modal { + constructor() { + super(); + } + renderBody() { return ; }