kopia lustrzana https://github.com/cheeaun/phanpy
Handle more filter context for notifications
rodzic
ed41d4c22e
commit
2bce5d480f
|
@ -460,7 +460,6 @@ function Notification({
|
||||||
const expandAccounts = diffCount ? 'remote' : 'local';
|
const expandAccounts = diffCount ? 'remote' : 'local';
|
||||||
|
|
||||||
// If there's a status and filter action is 'hide', then the notification is hidden
|
// If there's a status and filter action is 'hide', then the notification is hidden
|
||||||
// TODO: Handle 'warn' action one day
|
|
||||||
if (!!status?.filtered) {
|
if (!!status?.filtered) {
|
||||||
const isOwnPost = status?.account?.id === currentAccount;
|
const isOwnPost = status?.account?.id === currentAccount;
|
||||||
const filterInfo = isFiltered(status.filtered, 'notifications');
|
const filterInfo = isFiltered(status.filtered, 'notifications');
|
||||||
|
@ -710,6 +709,7 @@ function Notification({
|
||||||
size="s"
|
size="s"
|
||||||
previewMode
|
previewMode
|
||||||
allowContextMenu
|
allowContextMenu
|
||||||
|
allowFilters
|
||||||
/>
|
/>
|
||||||
</TruncatedLink>
|
</TruncatedLink>
|
||||||
</li>
|
</li>
|
||||||
|
@ -749,6 +749,7 @@ function Notification({
|
||||||
size="s"
|
size="s"
|
||||||
readOnly
|
readOnly
|
||||||
allowContextMenu
|
allowContextMenu
|
||||||
|
allowFilters
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<Status
|
<Status
|
||||||
|
@ -756,6 +757,7 @@ function Notification({
|
||||||
size="s"
|
size="s"
|
||||||
readOnly
|
readOnly
|
||||||
allowContextMenu
|
allowContextMenu
|
||||||
|
allowFilters
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</TruncatedLink>
|
</TruncatedLink>
|
||||||
|
|
|
@ -3679,7 +3679,7 @@ function FilteredStatus({
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
class={
|
class={`${
|
||||||
quoted
|
quoted
|
||||||
? ''
|
? ''
|
||||||
: isReblog
|
: isReblog
|
||||||
|
@ -3689,7 +3689,7 @@ function FilteredStatus({
|
||||||
: isFollowedTags
|
: isFollowedTags
|
||||||
? 'status-followed-tags'
|
? 'status-followed-tags'
|
||||||
: ''
|
: ''
|
||||||
}
|
} visibility-${visibility}`}
|
||||||
{...containerProps}
|
{...containerProps}
|
||||||
// title={statusPeekText}
|
// title={statusPeekText}
|
||||||
onContextMenu={(e) => {
|
onContextMenu={(e) => {
|
||||||
|
|
|
@ -18,7 +18,7 @@ import useInterval from '../utils/useInterval';
|
||||||
import useTitle from '../utils/useTitle';
|
import useTitle from '../utils/useTitle';
|
||||||
|
|
||||||
const FILTER_CONTEXT = ['home', 'public', 'notifications', 'thread', 'account'];
|
const FILTER_CONTEXT = ['home', 'public', 'notifications', 'thread', 'account'];
|
||||||
const FILTER_CONTEXT_UNIMPLEMENTED = ['notifications', 'thread', 'account'];
|
const FILTER_CONTEXT_UNIMPLEMENTED = ['thread', 'account'];
|
||||||
const FILTER_CONTEXT_LABELS = {
|
const FILTER_CONTEXT_LABELS = {
|
||||||
home: msg`Home and lists`,
|
home: msg`Home and lists`,
|
||||||
notifications: msg`Notifications`,
|
notifications: msg`Notifications`,
|
||||||
|
|
|
@ -14,6 +14,7 @@ import Loader from '../components/loader';
|
||||||
import Notification from '../components/notification';
|
import Notification from '../components/notification';
|
||||||
import { api } from '../utils/api';
|
import { api } from '../utils/api';
|
||||||
import db from '../utils/db';
|
import db from '../utils/db';
|
||||||
|
import FilterContext from '../utils/filter-context';
|
||||||
import { massageNotifications2 } from '../utils/group-notifications';
|
import { massageNotifications2 } from '../utils/group-notifications';
|
||||||
import states, { saveStatus } from '../utils/states';
|
import states, { saveStatus } from '../utils/states';
|
||||||
import { getCurrentAccountNS } from '../utils/store-utils';
|
import { getCurrentAccountNS } from '../utils/store-utils';
|
||||||
|
@ -185,6 +186,7 @@ function NotificationsMenu({ anchorRef, state, onClose }) {
|
||||||
<Trans>Notifications</Trans>
|
<Trans>Notifications</Trans>
|
||||||
</h2>
|
</h2>
|
||||||
</header>
|
</header>
|
||||||
|
<FilterContext.Provider value="notifications">
|
||||||
<main>
|
<main>
|
||||||
{snapStates.notifications.length ? (
|
{snapStates.notifications.length ? (
|
||||||
<>
|
<>
|
||||||
|
@ -218,6 +220,7 @@ function NotificationsMenu({ anchorRef, state, onClose }) {
|
||||||
)
|
)
|
||||||
)}
|
)}
|
||||||
</main>
|
</main>
|
||||||
|
</FilterContext.Provider>
|
||||||
<footer>
|
<footer>
|
||||||
<Link to="/mentions" class="button plain">
|
<Link to="/mentions" class="button plain">
|
||||||
<Icon icon="at" />{' '}
|
<Icon icon="at" />{' '}
|
||||||
|
|
|
@ -175,6 +175,7 @@ function Mentions({ columnMode, ...props }) {
|
||||||
useItemID
|
useItemID
|
||||||
timelineStart={TimelineStart}
|
timelineStart={TimelineStart}
|
||||||
refresh={type}
|
refresh={type}
|
||||||
|
filterContext="notifications"
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,7 @@ import Notification from '../components/notification';
|
||||||
import Status from '../components/status';
|
import Status from '../components/status';
|
||||||
import { api } from '../utils/api';
|
import { api } from '../utils/api';
|
||||||
import enhanceContent from '../utils/enhance-content';
|
import enhanceContent from '../utils/enhance-content';
|
||||||
|
import FilterContext from '../utils/filter-context';
|
||||||
import groupNotifications, {
|
import groupNotifications, {
|
||||||
groupNotifications2,
|
groupNotifications2,
|
||||||
massageNotifications2,
|
massageNotifications2,
|
||||||
|
@ -797,7 +798,7 @@ function Notifications({ columnMode }) {
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
{snapStates.notifications.length ? (
|
{snapStates.notifications.length ? (
|
||||||
<>
|
<FilterContext.Provider value="notifications">
|
||||||
{snapStates.notifications
|
{snapStates.notifications
|
||||||
// This is leaked from Notifications popover
|
// This is leaked from Notifications popover
|
||||||
.filter((n) => n.type !== 'follow_request')
|
.filter((n) => n.type !== 'follow_request')
|
||||||
|
@ -843,7 +844,7 @@ function Notifications({ columnMode }) {
|
||||||
</Fragment>
|
</Fragment>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</>
|
</FilterContext.Provider>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
{uiState === 'loading' && (
|
{uiState === 'loading' && (
|
||||||
|
|
Ładowanie…
Reference in New Issue