1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-11-23 13:13:49 +03:00
This commit is contained in:
Eugene Pankov 2021-10-31 17:38:30 +01:00
parent 9d8e19622f
commit da2ba0ec49
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4

View File

@ -67,9 +67,9 @@ export const TAB_COLORS = [
export function serializeFunction <T extends () => Promise<any>> (fn: T): T {
let queue = Promise.resolve()
return (...args) => {
return ((...args) => {
const res = queue.then(() => fn(...args))
queue = res.catch(() => null)
return res
}
}) as T
}