From 0092c8cbe91bf84939208337af2f84e9e0c81075 Mon Sep 17 00:00:00 2001 From: patak Date: Tue, 16 May 2023 10:45:22 +0200 Subject: [PATCH] fix: force using username@server settings if present --- composables/users.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/composables/users.ts b/composables/users.ts index 5847f7f8..5bdc33b7 100644 --- a/composables/users.ts +++ b/composables/users.ts @@ -357,19 +357,19 @@ export function useUserLocalStorage(key: string, initial: () = // Backward compatibility, respect webDomain in acct // In previous versions, acct was username@server instead of username@webDomain // for example: elk@m.webtoo.ls instead of elk@webtoo.ls - if (!all.value[id]) { - const [username, webDomain] = id.split('@') - const server = currentServer.value - if (webDomain && server && server !== webDomain) { - const oldId = `${username}@${server}` - const outdatedSettings = all.value[oldId] - if (outdatedSettings) { - const newAllValue = { ...all.value, [id]: outdatedSettings } - delete newAllValue[oldId] - all.value = newAllValue - } + // if (!all.value[id]) { // TODO: add back this condition in the future + const [username, webDomain] = id.split('@') + const server = currentServer.value + if (webDomain && server && server !== webDomain) { + const oldId = `${username}@${server}` + const outdatedSettings = all.value[oldId] + if (outdatedSettings) { + const newAllValue = { ...all.value, [id]: outdatedSettings } + delete newAllValue[oldId] + all.value = newAllValue } } + // } all.value[id] = Object.assign(initial(), all.value[id] || {}) return all.value[id] })