From 27d4e364e04c65a11c2855eaa9a1ffc55eb23239 Mon Sep 17 00:00:00 2001 From: f0x52 Date: Wed, 25 Jan 2023 09:47:55 +0100 Subject: [chore] Settings refactor fix4 (#1383) * fix error handling behavior in emoji overview and FormWithData components * css: long domain cutoff * unused require * eslint vscode task --- web/source/settings/admin/emoji/local/overview.js | 28 +++++++++++++++-------- web/source/settings/admin/federation/detail.js | 2 +- 2 files changed, 19 insertions(+), 11 deletions(-) (limited to 'web/source/settings/admin') diff --git a/web/source/settings/admin/emoji/local/overview.js b/web/source/settings/admin/emoji/local/overview.js index 78546b2fa..f8f61cea1 100644 --- a/web/source/settings/admin/emoji/local/overview.js +++ b/web/source/settings/admin/emoji/local/overview.js @@ -26,27 +26,35 @@ const NewEmojiForm = require("./new-emoji"); const query = require("../../../lib/query"); const { useEmojiByCategory } = require("../category-select"); const Loading = require("../../../components/loading"); +const { Error } = require("../../../components/error"); module.exports = function EmojiOverview({ baseUrl }) { const { data: emoji = [], isLoading, + isError, error } = query.useListEmojiQuery({ filter: "domain:local" }); + let content = null; + + if (isLoading) { + content = ; + } else if (isError) { + content = ; + } else { + content = ( + <> + + + + ); + } + return ( <>

Custom Emoji (local)

- {error && -
{error}
- } - {isLoading - ? - : <> - - - - } + {content} ); }; diff --git a/web/source/settings/admin/federation/detail.js b/web/source/settings/admin/federation/detail.js index 7324a42a5..ecace90cd 100644 --- a/web/source/settings/admin/federation/detail.js +++ b/web/source/settings/admin/federation/detail.js @@ -67,7 +67,7 @@ module.exports = function InstanceDetail({ baseUrl }) { return (
-

Federation settings for: {domain}

+

Federation settings for: {domain}

{infoContent}
-- cgit v1.2.3