Offline: persist Soapbox config (eg frontend_configurations or soapbox.json)

This commit is contained in:
Alex Gleason
2021-11-15 16:56:33 -06:00
parent 615cdc5c66
commit 7259ed58fb
5 changed files with 67 additions and 13 deletions

View File

@@ -0,0 +1,11 @@
export const getHost = instance => {
try {
return new URL(instance.get('uri')).host;
} catch {
try {
return new URL(`https://${instance.get('uri')}`).host;
} catch {
return null;
}
}
};