1
0
mirror of https://github.com/rhysd/Mstdn.git synced 2025-01-21 20:52:11 +01:00

do not see protocol scheme for partitions

This commit is contained in:
rhysd 2017-04-23 23:12:11 +09:00
parent 5429c0150c
commit da55de25d1

View File

@ -4,7 +4,13 @@ import log from './log';
import {Account} from './config';
export function partitionForAccount(account: Account) {
return `persist:mstdn:${account.name}:${account.host}`;
let host = account.host;
if (account.host.startsWith('https://')) {
host = host.slice(8);
} else if (account.host.startsWith('http://')) {
host = host.slice(7);
}
return `persist:mstdn:${account.name}:${host}`;
}
export default class AccountSwitcher extends EventEmitter {