Only display notification filter bar when supported

Signed-off-by: Nicole Mikołajczyk <git@mkljczk.pl>
This commit is contained in:
Nicole Mikołajczyk
2025-04-07 12:48:34 +02:00
parent 6f044f971d
commit 02673edcb0
4 changed files with 20 additions and 5 deletions

View File

@ -1067,6 +1067,11 @@ const getFeatures = (instance: Instance) => {
v.software === PLEROMA,
]),
/**
* @see GET /api/v1/notifications
*/
notificationsExcludeTypes: v.software !== MITRA,
/**
* @see GET /api/v1/notifications
*/

View File

@ -1,7 +1,7 @@
/**
* @category Request params
*/
interface CreateAccountParams {
type CreateAccountParams = {
/** String. The desired username for the account */
username: string;
/** String. The email address to be used for login */
@ -31,7 +31,15 @@ interface CreateAccountParams {
domain?: string;
accepts_email_list?: boolean;
}
/** Invite code */
invite_code?: string;
} & ({
/** EIP-4361 message */
message: string;
/** EIP-4361 signature (required if message is present) */
signature: string;
} | {})
/**
* @category Request params

View File

@ -1,6 +1,6 @@
{
"name": "pl-api",
"version": "1.0.0-rc.40",
"version": "1.0.0-rc.41",
"type": "module",
"homepage": "https://github.com/mkljczk/pl-fe/tree/develop/packages/pl-api",
"repository": {

View File

@ -17,6 +17,7 @@ import Portal from 'pl-fe/components/ui/portal';
import PlaceholderNotification from 'pl-fe/features/placeholder/components/placeholder-notification';
import { useAppDispatch } from 'pl-fe/hooks/use-app-dispatch';
import { useAppSelector } from 'pl-fe/hooks/use-app-selector';
import { useFeatures } from 'pl-fe/hooks/use-features';
import { useSettings } from 'pl-fe/hooks/use-settings';
import FilterBar from './components/filter-bar';
@ -54,10 +55,11 @@ const getNotifications = createSelector([
const Notifications = () => {
const dispatch = useAppDispatch();
const features = useFeatures();
const intl = useIntl();
const settings = useSettings();
const showFilterBar = settings.notifications.quickFilter.show;
const showFilterBar = (features.notificationsExcludeTypes || features.notificationsIncludeTypes) && settings.notifications.quickFilter.show;
const activeFilter = settings.notifications.quickFilter.active;
const [topNotification, setTopNotification] = useState<string>();
const { queuedNotificationCount, displayedNotifications } = useAppSelector(state => getNotifications(state, topNotification));
@ -188,7 +190,7 @@ const Notifications = () => {
);
return (
<Column label={intl.formatMessage(messages.title)} withHeader={false}>
<Column label={intl.formatMessage(messages.title)} withHeader={!showFilterBar}>
{filterBarContainer}
<Portal>