viewer: hide share errors

pull/175/head
Varun Patil 2022-11-07 05:33:07 -08:00
parent 166d6c3a9b
commit a489b504a4
1 changed files with 8 additions and 1 deletions

View File

@ -661,7 +661,14 @@ export default class Viewer extends Mixins(GlobalMixin) {
if (!(<any>navigator).canShare(data)) { if (!(<any>navigator).canShare(data)) {
throw new Error(this.t("memories", "Cannot share this type of data")); throw new Error(this.t("memories", "Cannot share this type of data"));
} }
await navigator.share(data);
try {
await navigator.share(data);
} catch (e) {
// Don't show this error because it's silly stuff
// like "share canceled"
console.error(e);
}
} catch (err) { } catch (err) {
console.error(err.name, err.message); console.error(err.name, err.message);
showError(err.message); showError(err.message);