1
0
mirror of https://github.com/vector-im/hydrogen-web.git synced 2025-01-12 04:57:18 +01:00

remove unneeded union type and simplify code

This commit is contained in:
Bruno Windels 2021-11-17 13:53:27 +01:00
parent 42e5fb33ba
commit fde0163b97

@ -187,9 +187,8 @@ export class LogItem implements ILogItem {
if (this.end) {
console.trace("log item is finished, additional logs will likely not be recorded");
}
let result: T | Promise<T>;
try {
result = callback(this);
const result = callback(this);
if (result instanceof Promise) {
return result.then(promiseResult => {
this.finish();