mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-15 01:52:42 +03:00
Merge pull request #4911 from urbit/lf/bag-of-grab
interface: misc grabbag
This commit is contained in:
commit
e80cd1ceb3
@ -328,6 +328,7 @@ export default class GraphApi extends BaseApi<StoreState> {
|
||||
|
||||
async getNewest(ship: string, resource: string, count: number, index = '') {
|
||||
const data = await this.scry<any>('graph-store', `/newest/${ship}/${resource}/${count}${index}`);
|
||||
data['graph-update'].fetch = true;
|
||||
this.store.handleEvent({ data });
|
||||
}
|
||||
|
||||
@ -335,7 +336,7 @@ export default class GraphApi extends BaseApi<StoreState> {
|
||||
const idx = index.split('/').map(decToUd).join('/');
|
||||
const data = await this.scry<any>('graph-store',
|
||||
`/node-siblings/older/${ship}/${resource}/${count}${idx}`
|
||||
);
|
||||
);
|
||||
this.store.handleEvent({ data });
|
||||
}
|
||||
|
||||
|
@ -180,9 +180,15 @@ const addNodes = (json, state) => {
|
||||
|
||||
const resource = data.resource.ship + '/' + data.resource.name;
|
||||
if (!(resource in state.graphs)) {
|
||||
state.graphs[resource] = new BigIntOrderedMap();
|
||||
if(json.fetch) {
|
||||
state.graphs[resource] = new BigIntOrderedMap();
|
||||
} else {
|
||||
// ignore updates until we load backlog deliberately, to avoid
|
||||
// unnecessary memory usage
|
||||
return state;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!(resource in state.graphTimesentMap)) {
|
||||
state.graphTimesentMap[resource] = {};
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ export default function Groups(props: GroupsProps & Parameters<typeof Box>[0]) {
|
||||
const notCount = graphNotifications(path);
|
||||
return (
|
||||
<Group
|
||||
key={group.metadata.title}
|
||||
key={group?.group}
|
||||
updates={notCount}
|
||||
first={index === 0}
|
||||
unreads={unreadCount}
|
||||
|
@ -43,7 +43,7 @@ function RecentGroups(props: { recent: string[] }) {
|
||||
</Box>
|
||||
{props.recent.filter((e) => {
|
||||
return (e in associations?.groups);
|
||||
}).slice(1, 5).map((g) => {
|
||||
}).slice(0, 4).map((g) => {
|
||||
const assoc = associations.groups[g];
|
||||
const color = uxToHex(assoc?.metadata?.color || '0x0');
|
||||
return (
|
||||
|
@ -53,7 +53,9 @@ export function GroupsPane(props: GroupsPaneProps) {
|
||||
if (workspace.type !== 'group') {
|
||||
return;
|
||||
}
|
||||
setRecentGroups(gs => _.uniq([workspace.group, ...gs]));
|
||||
return () => {
|
||||
setRecentGroups(gs => _.uniq([workspace.group, ...gs]));
|
||||
}
|
||||
}, [workspace]);
|
||||
|
||||
if (!(associations && (groupPath ? groupPath in groups : true))) {
|
||||
|
Loading…
Reference in New Issue
Block a user