diff --git a/app/soapbox/normalizers/soapbox/__tests__/soapbox-config.test.ts b/app/soapbox/normalizers/soapbox/__tests__/soapbox-config.test.ts index 5eccab870..6901254f2 100644 --- a/app/soapbox/normalizers/soapbox/__tests__/soapbox-config.test.ts +++ b/app/soapbox/normalizers/soapbox/__tests__/soapbox-config.test.ts @@ -37,6 +37,7 @@ describe('normalizeSoapboxConfig()', () => { it('upgrades singleUserModeProfile to redirectRootNoLogin', () => { expect(normalizeSoapboxConfig({ singleUserMode: true, singleUserModeProfile: 'alex' }).redirectRootNoLogin).toBe('/@alex'); + expect(normalizeSoapboxConfig({ singleUserMode: true, singleUserModeProfile: '@alex' }).redirectRootNoLogin).toBe('/@alex'); expect(normalizeSoapboxConfig({ singleUserMode: false, singleUserModeProfile: 'alex' }).redirectRootNoLogin).toBe(''); }); diff --git a/app/soapbox/normalizers/soapbox/soapbox-config.ts b/app/soapbox/normalizers/soapbox/soapbox-config.ts index f2366bdf1..eba76454c 100644 --- a/app/soapbox/normalizers/soapbox/soapbox-config.ts +++ b/app/soapbox/normalizers/soapbox/soapbox-config.ts @@ -198,13 +198,13 @@ const normalizeAdsAlgorithm = (soapboxConfig: SoapboxConfigMap): SoapboxConfigMa /** Single user mode is now managed by `redirectRootNoLogin`. */ const upgradeSingleUserMode = (soapboxConfig: SoapboxConfigMap): SoapboxConfigMap => { - const singleUserMode = soapboxConfig.get('singleUserMode'); - const singleUserModeProfile = soapboxConfig.get('singleUserModeProfile'); - const redirectRootNoLogin = soapboxConfig.get('redirectRootNoLogin'); + const singleUserMode = soapboxConfig.get('singleUserMode') as boolean | undefined; + const singleUserModeProfile = soapboxConfig.get('singleUserModeProfile') as string | undefined; + const redirectRootNoLogin = soapboxConfig.get('redirectRootNoLogin') as string | undefined; if (!redirectRootNoLogin && singleUserMode && singleUserModeProfile) { return soapboxConfig - .set('redirectRootNoLogin', `/@${singleUserModeProfile}`) + .set('redirectRootNoLogin', `/@${singleUserModeProfile.replaceAll('@', '')}`) .deleteAll(['singleUserMode', 'singleUserModeProfile']); } else { return soapboxConfig