mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 02:45:54 +01:00
client-ts: Port services/app/components/component
This commit is contained in:
@@ -301,7 +301,7 @@ function dynamicRequire(moduleName: string) {
|
||||
}
|
||||
}
|
||||
|
||||
function timeLimit(promise: Promise<void>, limitMs: number, errorMessage: string) {
|
||||
function timeLimit<T>(promise: Promise<T>, limitMs: number, errorMessage: string) {
|
||||
if (!promise || !promise.then) { // it's not actually a promise
|
||||
return promise;
|
||||
}
|
||||
@@ -309,7 +309,7 @@ function timeLimit(promise: Promise<void>, limitMs: number, errorMessage: string
|
||||
// better stack trace if created outside of promise
|
||||
const error = new Error(errorMessage || `Process exceeded time limit ${limitMs}`);
|
||||
|
||||
return new Promise((res, rej) => {
|
||||
return new Promise<T>((res, rej) => {
|
||||
let resolved = false;
|
||||
|
||||
promise.then(result => {
|
||||
|
||||
Reference in New Issue
Block a user