Strip protocol from instance domain/uri

This commit is contained in:
Lim Chee Aun 2023-01-31 00:58:00 +08:00
parent a2e47d7a6a
commit e282f5df2a

View file

@ -377,7 +377,12 @@ function initMasto(params) {
} = info;
if (uri || domain) {
const instances = store.local.getJSON('instances') || {};
instances[(domain || uri).toLowerCase()] = info;
instances[
(domain || uri)
.replace(/^https?:\/\//, '')
.replace(/\/+$/, '')
.toLowerCase()
] = info;
store.local.setJSON('instances', instances);
}
if (streamingApi || streaming) {