From 4ccbce71e0a272e982697b0d0f5c9d94da028ee5 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Mon, 21 Mar 2022 15:13:33 -0500 Subject: [PATCH] Fetch frontend_configurations once again, reenable /soapbox/config route --- app/soapbox/actions/soapbox.js | 26 +++++++++---------- app/soapbox/features/ui/components/navbar.tsx | 2 +- app/soapbox/features/ui/index.js | 4 +-- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/app/soapbox/actions/soapbox.js b/app/soapbox/actions/soapbox.js index 34e1c723d..91e1a26f2 100644 --- a/app/soapbox/actions/soapbox.js +++ b/app/soapbox/actions/soapbox.js @@ -5,7 +5,7 @@ import { getHost } from 'soapbox/actions/instance'; import KVStore from 'soapbox/storage/kv_store'; import { getFeatures } from 'soapbox/utils/features'; -import { staticClient } from '../api'; +import api, { staticClient } from '../api'; export const SOAPBOX_CONFIG_REQUEST_SUCCESS = 'SOAPBOX_CONFIG_REQUEST_SUCCESS'; export const SOAPBOX_CONFIG_REQUEST_FAIL = 'SOAPBOX_CONFIG_REQUEST_FAIL'; @@ -88,19 +88,17 @@ export function rememberSoapboxConfig(host) { } export function fetchSoapboxConfig(host) { - return fetchSoapboxJson(host); - - // return (dispatch, getState) => { - // api(getState).get('/api/pleroma/frontend_configurations').then(response => { - // if (response.data.soapbox_fe) { - // dispatch(importSoapboxConfig(response.data.soapbox_fe, host)); - // } else { - // dispatch(fetchSoapboxJson(host)); - // } - // }).catch(error => { - // dispatch(fetchSoapboxJson(host)); - // }); - // }; + return (dispatch, getState) => { + api(getState).get('/api/pleroma/frontend_configurations').then(response => { + if (response.data.soapbox_fe) { + dispatch(importSoapboxConfig(response.data.soapbox_fe, host)); + } else { + dispatch(fetchSoapboxJson(host)); + } + }).catch(error => { + dispatch(fetchSoapboxJson(host)); + }); + }; } // Tries to remember the config from browser storage before fetching it diff --git a/app/soapbox/features/ui/components/navbar.tsx b/app/soapbox/features/ui/components/navbar.tsx index 5faf1aba6..2f6ffe8df 100644 --- a/app/soapbox/features/ui/components/navbar.tsx +++ b/app/soapbox/features/ui/components/navbar.tsx @@ -48,7 +48,7 @@ const Navbar = () => { > {logo ? ( - Logo + Logo ) : ( diff --git a/app/soapbox/features/ui/index.js b/app/soapbox/features/ui/index.js index 3acc6d054..1b5179e7f 100644 --- a/app/soapbox/features/ui/index.js +++ b/app/soapbox/features/ui/index.js @@ -89,7 +89,7 @@ import { EditPassword, EmailConfirmation, DeleteAccount, - // SoapboxConfig, + SoapboxConfig, // ExportData, // ImportData, // Backups, @@ -330,7 +330,7 @@ class SwitchingColumnsArea extends React.PureComponent { {/* */} - {/* */} + {/*