Bug fix
This commit is contained in:
parent
8e783b0eb6
commit
455cdc4bf0
@ -111,6 +111,7 @@ export default function Note(props) {
|
||||
if (typeof f === "string") {
|
||||
return f.split(UrlRegex).map(a => {
|
||||
if (a.startsWith("http")) {
|
||||
try {
|
||||
let url = new URL(a);
|
||||
let ext = url.pathname.toLowerCase().match(FileExtensionRegex);
|
||||
if (ext) {
|
||||
@ -133,6 +134,9 @@ export default function Note(props) {
|
||||
} else {
|
||||
return <a href={url}>{url.toString()}</a>
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn(`Not a valid url: ${a}`);
|
||||
}
|
||||
}
|
||||
return a;
|
||||
});
|
||||
|
@ -43,6 +43,7 @@ export default class Connection {
|
||||
}
|
||||
|
||||
OnMessage(e) {
|
||||
if (e.data.length > 0) {
|
||||
let msg = JSON.parse(e.data);
|
||||
let tag = msg[0];
|
||||
switch (tag) {
|
||||
@ -69,6 +70,7 @@ export default class Connection {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
OnError(e) {
|
||||
console.log(e);
|
||||
|
Loading…
x
Reference in New Issue
Block a user