From da55de25d1227598fb0ca8e91cad4644557c07d3 Mon Sep 17 00:00:00 2001 From: rhysd Date: Sun, 23 Apr 2017 23:12:11 +0900 Subject: [PATCH] do not see protocol scheme for partitions --- main/account_switcher.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main/account_switcher.ts b/main/account_switcher.ts index 6620609..4c9fdc2 100644 --- a/main/account_switcher.ts +++ b/main/account_switcher.ts @@ -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 {