fix issue with mastodon modal
This commit is contained in:
parent
06e0f1fc3e
commit
c8b1bd07d2
|
@ -13,12 +13,10 @@
|
||||||
|
|
||||||
const mastodonUrlModal: ModalSettings = {
|
const mastodonUrlModal: ModalSettings = {
|
||||||
type: 'prompt',
|
type: 'prompt',
|
||||||
// Data
|
|
||||||
title: 'Mastodon instance URL',
|
title: 'Mastodon instance URL',
|
||||||
valueAttr: { type: 'text', placeholder: 'https://mastodon.social' },
|
valueAttr: { type: 'text', required: true, placeholder: 'https://mastodon.social' },
|
||||||
// Returns the updated response value
|
response: (r: string | false) => {
|
||||||
response: (r: string) => {
|
if (!r) return;
|
||||||
// Strip everything but the host and tld
|
|
||||||
const url = new URL(r);
|
const url = new URL(r);
|
||||||
const host = url.host;
|
const host = url.host;
|
||||||
window.open(`https://${host}/share?text=${encodeURIComponent(shareMessage)}`, '_blank');
|
window.open(`https://${host}/share?text=${encodeURIComponent(shareMessage)}`, '_blank');
|
||||||
|
|
Loading…
Reference in New Issue