try web share api

This commit is contained in:
Danny Coates 2019-03-09 17:59:06 -08:00
parent aa56216e76
commit 9294ecb09f
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB
3 changed files with 68 additions and 2 deletions

View file

@ -5,6 +5,7 @@ import * as metrics from './metrics';
import { bytes } from './utils';
import okDialog from './ui/okDialog';
import copyDialog from './ui/copyDialog';
import shareDialog from './ui/shareDialog';
import signupDialog from './ui/signupDialog';
export default function(state, emitter) {
@ -168,7 +169,9 @@ export default function(state, emitter) {
file: ownedFile
});
}
state.modal = copyDialog(ownedFile.name, ownedFile.url);
state.modal = state.capabilities.share
? shareDialog(ownedFile.name, ownedFile.url)
: copyDialog(ownedFile.name, ownedFile.url);
} catch (err) {
if (err.message === '0') {
//cancelled. do nothing