mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
In the client, don't wait if the stub doesn't return a promise
This commit is contained in:
@@ -695,7 +695,14 @@ export class Connection {
|
||||
invocation
|
||||
);
|
||||
try {
|
||||
stubOptions.stubReturnValue = await stubInvocation();
|
||||
const resultOrThenable = stubInvocation();
|
||||
const isThenable =
|
||||
resultOrThenable && typeof resultOrThenable.then === 'function';
|
||||
if (isThenable) {
|
||||
stubOptions.stubReturnValue = await resultOrThenable;
|
||||
} else {
|
||||
stubOptions.stubReturnValue = resultOrThenable;
|
||||
}
|
||||
} finally {
|
||||
DDP._CurrentMethodInvocation._set(currentContext);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user