Normalize export to fle and share link behaviour.

Summary:
Both export methods behaved slightly differently:
* Export to file returned earlier when running in background, which skiped the tracking of export termination;
* Share link always showed notification, even when on foreground;
* Share link status "hanged" - the share was never unset.

This change makes both consistent:
* Always track export finish - whether its in foreground or background;
* Only show notificaiton if running in background;
* Always reset the share/status.

On top of this it also:
* Normalizes the screenshot status to terminate in '...' as all the others;
* Only copies export URL to clipboard when exporting link if running in the background.

Reviewed By: passy

Differential Revision: D21425095

fbshipit-source-id: 9864a63269df6bd05ab065ff0e5d9f17b9ac6db6
This commit is contained in:
João Vieira
2020-05-07 04:02:41 -07:00
committed by Facebook GitHub Bot
parent a2d7297bbb
commit 64deaee5a7
3 changed files with 12 additions and 10 deletions

View File

@@ -383,7 +383,7 @@ export const processStore = async (
if (device) {
const {serial} = device;
statusUpdate && statusUpdate('Capturing screenshot');
statusUpdate && statusUpdate('Capturing screenshot...');
const deviceScreenshot = await capture(device).catch((e) => {
console.warn('Failed to capture device screenshot when exporting. ' + e);
return null;
@@ -413,7 +413,7 @@ export const processStore = async (
idler,
);
statusUpdate && statusUpdate('Uploading screenshot');
statusUpdate && statusUpdate('Uploading screenshot...');
const deviceScreenshotLink =
deviceScreenshot &&
(await uploadFlipperMedia(deviceScreenshot, 'Image').catch((e) => {