mirror of
https://github.com/urbit/shrub.git
synced 2024-11-28 05:22:27 +03:00
Merge remote-tracking branch 'origin/la/fix-archivebox' into release/next-sys
This commit is contained in:
commit
39cc1c51ec
@ -196,12 +196,10 @@ export class HarkApi extends BaseApi<StoreState> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
getMore(archive = false) {
|
getMore() {
|
||||||
const offset = this.store.state[
|
const offset = this.store.state['notifications']?.size || 0;
|
||||||
archive ? 'archivedNotifications' : 'notifications'
|
|
||||||
]?.size || 0;
|
|
||||||
const count = 3;
|
const count = 3;
|
||||||
return this.getSubset(offset,count, archive);
|
return this.getSubset(offset, count, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getSubset(offset:number, count:number, isArchive: boolean) {
|
async getSubset(offset:number, count:number, isArchive: boolean) {
|
||||||
|
@ -363,12 +363,5 @@ function archive(json: any, state: HarkState) {
|
|||||||
notifIdxEqual(index, idxNotif.index)
|
notifIdxEqual(index, idxNotif.index)
|
||||||
);
|
);
|
||||||
state.notifications.set(time, unarchived);
|
state.notifications.set(time, unarchived);
|
||||||
state.archivedNotifications.set(time, [
|
|
||||||
...archiveBox,
|
|
||||||
...archived.map(({ notification, index }) => ({
|
|
||||||
notification: { ...notification, read: true },
|
|
||||||
index,
|
|
||||||
})),
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -148,7 +148,6 @@ export default function Inbox(props: {
|
|||||||
api={api}
|
api={api}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{_.map(
|
{_.map(
|
||||||
notificationsByDay,
|
notificationsByDay,
|
||||||
(timeboxes, idx) =>
|
(timeboxes, idx) =>
|
||||||
|
@ -100,7 +100,7 @@ function NotificationWrapper(props: {
|
|||||||
</StatelessAsyncAction>
|
</StatelessAsyncAction>
|
||||||
{!props.archived && (
|
{!props.archived && (
|
||||||
<StatelessAsyncAction name={time.toString()} onClick={onArchive} backgroundColor="transparent">
|
<StatelessAsyncAction name={time.toString()} onClick={onArchive} backgroundColor="transparent">
|
||||||
Archive
|
Dismiss
|
||||||
</StatelessAsyncAction>
|
</StatelessAsyncAction>
|
||||||
)}
|
)}
|
||||||
</Row>
|
</Row>
|
||||||
|
@ -70,11 +70,6 @@ export default function NotificationsScreen(props: any) {
|
|||||||
Inbox
|
Inbox
|
||||||
</HeaderLink>
|
</HeaderLink>
|
||||||
</Box>
|
</Box>
|
||||||
<Box>
|
|
||||||
<HeaderLink current={view} view="archive">
|
|
||||||
Archive
|
|
||||||
</HeaderLink>
|
|
||||||
</Box>
|
|
||||||
<Box>
|
<Box>
|
||||||
<HeaderLink current={view} view="preferences">
|
<HeaderLink current={view} view="preferences">
|
||||||
Preferences
|
Preferences
|
||||||
@ -115,14 +110,6 @@ export default function NotificationsScreen(props: any) {
|
|||||||
</Box>
|
</Box>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
</Row>
|
</Row>
|
||||||
{view === "archive" && (
|
|
||||||
<Inbox
|
|
||||||
{...props}
|
|
||||||
archive={props.archivedNotifications}
|
|
||||||
showArchive
|
|
||||||
filter={filter.groups}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
{view === "preferences" && (
|
{view === "preferences" && (
|
||||||
<NotificationPreferences
|
<NotificationPreferences
|
||||||
graphConfig={props.notificationsGraphConfig}
|
graphConfig={props.notificationsGraphConfig}
|
||||||
|
Loading…
Reference in New Issue
Block a user