Merge pull request #5281 from urbit/lf/landscape-fix

landscape: fix chats not bumping, hide spinner correctly
This commit is contained in:
fang 2021-10-04 21:25:29 +02:00 committed by GitHub
commit 0a847c11f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 23 deletions

View File

@ -112,7 +112,8 @@ function updateNotificationStats(state: HarkState, place: HarkPlace, f: (s: Hark
function seenIndex(json: any, state: HarkState): HarkState {
const data = _.get(json, 'saw-place');
if(data) {
updateNotificationStats(state, data, s => ({ last: Date.now() }));
const last = data?.time || Date.now();
updateNotificationStats(state, data.place, s => ({ last }));
}
return state;
}

View File

@ -1,5 +1,5 @@
import { LoadingSpinner, Button } from '@tlon/indigo-react';
import React from 'react';
import React from 'react';
import { Box, Row, Col, Text } from '@tlon/indigo-react';
import { PropFunc } from '~/types';
import _ from 'lodash';
@ -40,8 +40,8 @@ function Elbow(
export function StatusBarJoins() {
const pendingJoin = useGroupState(s => s.pendingJoin);
if (
Object.keys(_.omitBy(pendingJoin, j => j.progress === 'done')).length ===
0
Object.keys(_.omitBy(pendingJoin, j => j.hidden || j.progress === 'done'))
.length === 0
) {
return null;
}
@ -63,9 +63,9 @@ export function StatusBarJoins() {
borderRadius="1"
backgroundColor="white"
>
{Object.keys(pendingJoin).map(g => (
<JoinStatus key={g} group={g} join={pendingJoin[g]} />
))}
{Object.keys(pendingJoin).map(g => (
<JoinStatus key={g} group={g} join={pendingJoin[g]} />
))}
</Col>
}
alignX="left"
@ -101,21 +101,19 @@ export function JoinStatus({
};
return (
<Row alignItems="center" gapX="3">
<Col gapY="2">
<Row alignItems="center" gapX="2">
{preview ? (
<MetadataIcon height={4} width={4} metadata={preview.metadata} />
) : null}
<Text>{preview?.metadata.title || group.slice(6)}</Text>
</Row>
<Row ml="2" alignItems="center" gapX="2">
<Elbow />
<Text>{desc}</Text>
</Row>
</Col>
<Button onClick={onHide}>
Hide
</Button>
</Row>
<Col gapY="2">
<Row alignItems="center" gapX="2">
{preview ? (
<MetadataIcon height={4} width={4} metadata={preview.metadata} />
) : null}
<Text>{preview?.metadata.title || group.slice(6)}</Text>
</Row>
<Row ml="2" alignItems="center" gapX="2">
<Elbow />
<Text>{desc}</Text>
</Row>
</Col>
<Button onClick={onHide}>Hide</Button>
</Row>
);
}