diff --git a/file.ts b/file.ts index ff084d0e..cecb9766 100644 --- a/file.ts +++ b/file.ts @@ -265,7 +265,7 @@ namespace server { } else { server = http.createServer(handleHTTPRequest); } - await new Promise((resolve, reject) => { + await new Promise((resolve, reject) => { server.on('error', reject); server.listen(options.port, () => { server.off("error", reject); @@ -276,7 +276,7 @@ namespace server { export async function shutdown() { if(server) { - await new Promise((resolve, reject) => server.close(error => error ? reject(error) : resolve())); + await new Promise((resolve, reject) => server.close(error => error ? reject(error) : resolve())); server = undefined; } } @@ -396,7 +396,7 @@ namespace watcher { this._process.addListener("error", this.handle_error.bind(this)); try { - await new Promise((resolve, reject) => { + await new Promise((resolve, reject) => { const id = setTimeout(reject, 5000, "timeout"); this._callback_init = () => { clearTimeout(id); diff --git a/package-lock.json b/package-lock.json index 465c1262..cd65c90c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17728,9 +17728,8 @@ "dev": true }, "resize-observer-polyfill": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz", - "integrity": "sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==" + "version": "git+https://github.com/albancreton/resize-observer-polyfill.git#cee973d8e1163201fd535d4b54d3cdd620333deb", + "from": "git+https://github.com/albancreton/resize-observer-polyfill.git#patch-1" }, "resolve": { "version": "1.15.1", diff --git a/package.json b/package.json index 4bf9e969..5c0c465c 100644 --- a/package.json +++ b/package.json @@ -116,7 +116,7 @@ "react-grid-layout": "^1.2.2", "react-player": "^2.5.0", "remarkable": "^2.0.1", - "resize-observer-polyfill": "^1.5.1", + "resize-observer-polyfill": "git+https://github.com/albancreton/resize-observer-polyfill.git#patch-1", "sdp-transform": "^2.14.0", "simple-jsonp-promise": "^1.1.0", "stream-browserify": "^3.0.0", diff --git a/shared/img/icon_folder.svg b/shared/img/icon_folder.svg index c20bcd50..236c4e91 100644 --- a/shared/img/icon_folder.svg +++ b/shared/img/icon_folder.svg @@ -1,4 +1,4 @@ - + diff --git a/shared/img/icon_sound_pause.svg b/shared/img/icon_sound_pause.svg index 9789c620..51ff2532 100644 --- a/shared/img/icon_sound_pause.svg +++ b/shared/img/icon_sound_pause.svg @@ -1,2 +1,2 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/shared/img/icon_sound_play.svg b/shared/img/icon_sound_play.svg index 6b61f0d7..32799749 100644 --- a/shared/img/icon_sound_play.svg +++ b/shared/img/icon_sound_play.svg @@ -1,2 +1,2 @@ -play-glyph \ No newline at end of file +play-glyph \ No newline at end of file diff --git a/shared/img/loading_image.svg b/shared/img/loading_image.svg index 8f33a2b7..fb4114c1 100644 --- a/shared/img/loading_image.svg +++ b/shared/img/loading_image.svg @@ -1,107 +1,27 @@ - -image/svg+xml - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/shared/img/script.svg b/shared/img/script.svg index ea32f4c0..5557a658 100644 --- a/shared/img/script.svg +++ b/shared/img/script.svg @@ -1,6 +1,4 @@ - - diff --git a/shared/js/Mutex.ts b/shared/js/Mutex.ts index 754d916f..c73447de 100644 --- a/shared/js/Mutex.ts +++ b/shared/js/Mutex.ts @@ -19,7 +19,7 @@ export class Mutex { execute(callback: (value: T, setValue: (newValue: T) => void) => R | Promise) : Promise { return new Promise((resolve, reject) => { - this.taskQueue.push(() => new Promise(taskResolve => { + this.taskQueue.push(() => new Promise(taskResolve => { try { const result = callback(this.value, newValue => this.value = newValue); if(result instanceof Promise) { diff --git a/shared/js/connection/rtc/RemoteTrack.ts b/shared/js/connection/rtc/RemoteTrack.ts index 643a93fd..32df32fe 100644 --- a/shared/js/connection/rtc/RemoteTrack.ts +++ b/shared/js/connection/rtc/RemoteTrack.ts @@ -141,7 +141,6 @@ export class RemoteRTPAudioTrack extends RemoteRTPTrack { this.htmlAudioNode.srcObject = this.mediaStream; this.htmlAudioNode.autoplay = true; this.htmlAudioNode.muted = true; - this.htmlAudioNode.msRealTime = true; /* { diff --git a/shared/js/connectionlog/History.ts b/shared/js/connectionlog/History.ts index 1aa4ec1a..31e4ca85 100644 --- a/shared/js/connectionlog/History.ts +++ b/shared/js/connectionlog/History.ts @@ -339,9 +339,9 @@ export class ConnectionHistory { break; } - promises.push(new Promise(resolve => { + promises.push(new Promise(resolve => { const deleteRequest = entry.delete(); - deleteRequest.onsuccess = resolve; + deleteRequest.onsuccess = () => resolve(); deleteRequest.onerror = () => { logWarn(LogCategory.GENERAL, tr("Failed to delete a connection attempt: %o"), deleteRequest.error); resolve(); diff --git a/shared/js/conversations/PrivateConversationHistory.ts b/shared/js/conversations/PrivateConversationHistory.ts index ef871196..02e05fd3 100644 --- a/shared/js/conversations/PrivateConversationHistory.ts +++ b/shared/js/conversations/PrivateConversationHistory.ts @@ -22,7 +22,7 @@ async function requestDatabase() { if(databaseMode === "open") { return; } else if(databaseMode === "opening" || databaseMode === "updating") { - await new Promise(resolve => databaseStateChangedCallbacks.push(resolve)); + await new Promise(resolve => databaseStateChangedCallbacks.push(resolve)); } else if(databaseMode === "closed") { try { await doOpenDatabase(false); @@ -285,7 +285,7 @@ export async function queryConversationEvents(clientUniqueId: string, query: { const events = []; let hasMoreEvents = false; - await new Promise((resolve, reject) => { + await new Promise((resolve, reject) => { cursor.onsuccess = () => { if(!cursor.result) { /* no more results */ diff --git a/shared/js/file/RemoteAvatars.ts b/shared/js/file/RemoteAvatars.ts index 1dc63aff..ff9ff213 100644 --- a/shared/js/file/RemoteAvatars.ts +++ b/shared/js/file/RemoteAvatars.ts @@ -166,7 +166,7 @@ class RemoteAvatarManagerFactory extends AbstractAvatarManagerFactory { async initialize() { this.ipcChannel.sendMessage("query-handlers", {}); - await new Promise((resolve, reject) => { + await new Promise((resolve, reject) => { const timeout = setTimeout(() => { this.callbackHandlerQueried = undefined; reject(tr("handler query timeout")); diff --git a/shared/js/file/RemoteIcons.ts b/shared/js/file/RemoteIcons.ts index 82ff40e8..2e2bcbff 100644 --- a/shared/js/file/RemoteIcons.ts +++ b/shared/js/file/RemoteIcons.ts @@ -39,7 +39,7 @@ class RemoteIconManager extends AbstractIconManager { async initialize() { this.ipcChannel.sendMessage("initialize", {}); - await new Promise((resolve, reject) => { + await new Promise((resolve, reject) => { const timeout = setTimeout(() => { this.callbackInitialized = undefined; reject(tr("initialize timeout")); diff --git a/shared/js/main.tsx b/shared/js/main.tsx index ff935fe0..9f898c5f 100644 --- a/shared/js/main.tsx +++ b/shared/js/main.tsx @@ -213,7 +213,7 @@ async function doHandleConnectRequest(serverAddress: string, serverUniqueId: str return { status: "client-aborted" }; } - await new Promise(resolve => getAudioBackend().executeWhenInitialized(resolve)); + await new Promise(resolve => getAudioBackend().executeWhenInitialized(resolve)); } const clientNickname = parameters.getValue(AppParameters.KEY_CONNECT_NICKNAME, undefined); diff --git a/shared/js/music/PlaylistManager.ts b/shared/js/music/PlaylistManager.ts index 4cded206..2b2ba4a9 100644 --- a/shared/js/music/PlaylistManager.ts +++ b/shared/js/music/PlaylistManager.ts @@ -170,11 +170,11 @@ export abstract class SubscribedPlaylist { * * @param forceQuery Forcibly query even we're subscribed and already aware of all songs. */ - abstract async querySongs(forceQuery: boolean) : Promise; + abstract querySongs(forceQuery: boolean) : Promise; - abstract async addSong(url: string, urlLoader: "any" | "youtube" | "ffmpeg" | "channel", targetSongId: number | 0, mode?: "before" | "after" | "last") : Promise; - abstract async deleteEntry(entryId: number) : Promise; - abstract async reorderEntry(entryId: number, targetEntryId: number, mode: "before" | "after") : Promise; + abstract addSong(url: string, urlLoader: "any" | "youtube" | "ffmpeg" | "channel", targetSongId: number | 0, mode?: "before" | "after" | "last") : Promise; + abstract deleteEntry(entryId: number) : Promise; + abstract reorderEntry(entryId: number, targetEntryId: number, mode: "before" | "after") : Promise; getStatus() : Readonly { return this.status; diff --git a/shared/js/ui/modal/yes-no/Controller.ts b/shared/js/ui/modal/yes-no/Controller.ts index bdabbffc..0e2dbf71 100644 --- a/shared/js/ui/modal/yes-no/Controller.ts +++ b/shared/js/ui/modal/yes-no/Controller.ts @@ -63,7 +63,7 @@ export async function promptYesNo(properties: YesNoParameters) : Promise(resolve => { - modal.getEvents().on("destroy", () => resolve()); + modal.getEvents().on("destroy", () => resolve(undefined)); controller.events.on("action_submit", event => { resolve(event.status); modal.destroy(); diff --git a/shared/js/ui/react-elements/modal/external/Controller.ts b/shared/js/ui/react-elements/modal/external/Controller.ts index 05433506..87f6ea9e 100644 --- a/shared/js/ui/react-elements/modal/external/Controller.ts +++ b/shared/js/ui/react-elements/modal/external/Controller.ts @@ -158,7 +158,7 @@ export class ExternalModalController implements ModalInstanceController { this.windowId = result.windowId; try { if(!this.modalInitialized) { - await new Promise((resolve, reject) => { + await new Promise((resolve, reject) => { const timeoutId = setTimeout(reject, 15000); this.modalInitializeCallback = () => { clearTimeout(timeoutId); diff --git a/shared/js/ui/react-elements/modal/internal/index.tsx b/shared/js/ui/react-elements/modal/internal/index.tsx index 5fe61ed9..4b0b5925 100644 --- a/shared/js/ui/react-elements/modal/internal/index.tsx +++ b/shared/js/ui/react-elements/modal/internal/index.tsx @@ -111,7 +111,7 @@ export class InternalModalInstance implements ModalInstanceController { throw tr("missing modal hanging container"); } - await new Promise(resolve => internalModalContainer.current.addModalInstance(this, resolve)); + await new Promise(resolve => internalModalContainer.current.addModalInstance(this, resolve)); if(!this.refRendererInstance.current) { this.destructModalInstance(); throw tr("missing rendered modal reference"); @@ -162,7 +162,7 @@ export class InternalModalInstance implements ModalInstanceController { this.modalInstance["onOpen"](); this.state = ModalState.SHOWN; - await new Promise(resolve => this.refRendererInstance.current.setState({ shown: true }, resolve)); + await new Promise(resolve => this.refRendererInstance.current.setState({ shown: true }, resolve)); this.events.fire("notify_open"); } @@ -177,7 +177,7 @@ export class InternalModalInstance implements ModalInstanceController { this.state = ModalState.HIDDEN; this.modalInstance["onClose"](); - await new Promise(resolve => this.refRendererInstance.current.setState({ shown: false }, resolve)); + await new Promise(resolve => this.refRendererInstance.current.setState({ shown: false }, resolve)); /* TODO: Somehow get the real animation finish signal? */ await new Promise(resolve => setTimeout(resolve, 500));