Merge remote-tracking branch 'upstream/develop' into compact-reply-rendering

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner 2021-07-15 14:54:06 +02:00
commit 7f9f2dbbcb
No known key found for this signature in database
GPG key ID: 9760693FDD98A790
109 changed files with 1345 additions and 727 deletions

View file

@ -26,7 +26,7 @@ Once a timer is finished or aborted, it can't be started again
a new one through `clone()` or `cloneIfRun()`.
*/
export default class Timer {
private timerHandle: NodeJS.Timeout;
private timerHandle: number;
private startTs: number;
private promise: Promise<void>;
private resolve: () => void;

View file

@ -386,7 +386,7 @@ export default class WidgetUtils {
});
}
static removeIntegrationManagerWidgets(): Promise<void> {
static async removeIntegrationManagerWidgets(): Promise<void> {
const client = MatrixClientPeg.get();
if (!client) {
throw new Error('User not logged in');
@ -399,7 +399,7 @@ export default class WidgetUtils {
delete userWidgets[key];
}
});
return client.setAccountData('m.widgets', userWidgets);
await client.setAccountData('m.widgets', userWidgets);
}
static addIntegrationManagerWidget(name: string, uiUrl: string, apiUrl: string): Promise<void> {
@ -407,7 +407,7 @@ export default class WidgetUtils {
"integration_manager_" + (new Date().getTime()),
WidgetType.INTEGRATION_MANAGER,
uiUrl,
"Integration Manager: " + name,
"Integration manager: " + name,
{ "api_url": apiUrl },
);
}
@ -416,7 +416,7 @@ export default class WidgetUtils {
* Remove all stickerpicker widgets (stickerpickers are user widgets by nature)
* @return {Promise} Resolves on account data updated
*/
static removeStickerpickerWidgets(): Promise<void> {
static async removeStickerpickerWidgets(): Promise<void> {
const client = MatrixClientPeg.get();
if (!client) {
throw new Error('User not logged in');
@ -429,7 +429,7 @@ export default class WidgetUtils {
delete userWidgets[key];
}
});
return client.setAccountData('m.widgets', userWidgets);
await client.setAccountData('m.widgets', userWidgets);
}
static makeAppConfig(

View file

@ -14,6 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// @ts-ignore - `.ts` is needed here to make TS happy
import IndexedDBWorker from "../workers/indexeddb.worker.ts";
import { createClient, ICreateClientOpts } from "matrix-js-sdk/src/matrix";
import { IndexedDBCryptoStore } from "matrix-js-sdk/src/crypto/store/indexeddb-crypto-store";
import { WebStorageSessionStore } from "matrix-js-sdk/src/store/session/webstorage";
@ -35,10 +37,6 @@ try {
* @param {Object} opts options to pass to Matrix.createClient. This will be
* extended with `sessionStore` and `store` members.
*
* @property {string} indexedDbWorkerScript Optional URL for a web worker script
* for IndexedDB store operations. By default, indexeddb ops are done on
* the main thread.
*
* @returns {MatrixClient} the newly-created MatrixClient
*/
export default function createMatrixClient(opts: ICreateClientOpts) {
@ -51,7 +49,7 @@ export default function createMatrixClient(opts: ICreateClientOpts) {
indexedDB: indexedDB,
dbName: "riot-web-sync",
localStorage: localStorage,
workerScript: createMatrixClient.indexedDbWorkerScript,
workerFactory: () => new IndexedDBWorker(),
});
}
@ -70,5 +68,3 @@ export default function createMatrixClient(opts: ICreateClientOpts) {
...opts,
});
}
createMatrixClient.indexedDbWorkerScript = null;