Commit hash field added

Summary:
This diff adds commit hash field in the support form v2 and we prefill the information.

If changes are not pushed to phabricator we will populate it with commit hash or else we will populate it with Diff number.

See the demo to understand the flow.

{F222000517}

Reviewed By: jknoxville

Differential Revision: D18427044

fbshipit-source-id: 80a58baca381e21203da5670e29144a7e8c2eeed
This commit is contained in:
Pritesh Nandgaonkar
2019-11-12 04:51:32 -08:00
committed by Facebook Github Bot
parent 774fddb6bf
commit 5bdba4935a

View File

@@ -7,6 +7,8 @@
* @format
*/
import {StatusMessageType} from '../reducers/application';
export default function promiseTimeout<T>(
ms: number,
promise: Promise<T>,
@@ -23,3 +25,23 @@ export default function promiseTimeout<T>(
// Returns a race between our timeout and the passed in promise
return Promise.race([promise, timeout]);
}
export function showStatusUpdatesForPromise<T>(
promise: Promise<T>,
message: string,
sender: string,
addStatusMessage: (payload: StatusMessageType) => void,
removeStatusMessage: (payload: StatusMessageType) => void,
): Promise<T> {
const statusMsg = {msg: message, sender};
addStatusMessage(statusMsg);
return promise
.then(result => {
removeStatusMessage(statusMsg);
return result;
})
.catch(e => {
removeStatusMessage(statusMsg);
throw e;
});
}