add error handling for invalid URLs
This commit is contained in:
parent
2a7dc36678
commit
c7e1c4e6a7
1 changed files with 5 additions and 1 deletions
|
|
@ -48,7 +48,11 @@ BR.ShareRoute = L.Class.extend({
|
|||
}
|
||||
|
||||
if (BR.Util.localStorageAvailable()) {
|
||||
try {
|
||||
localStorage.setItem('share/mastodonInstance', new URL(mastodonServer).hostname);
|
||||
} catch (exception) {
|
||||
console.error('Cannot store Mastodon instance', exception);
|
||||
}
|
||||
}
|
||||
|
||||
window.open(mastodonServer + '/share?text=' + encodeURIComponent(self.getShareUrl()), '_blank');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue