mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-13 08:38:43 +03:00
interface: rename to dm-inbox
This commit is contained in:
parent
6223430ee3
commit
1af5630bcc
@ -207,7 +207,7 @@ export default class GraphApi extends BaseApi<StoreState> {
|
||||
const post = createPost(contents, `/${patp2dec(ship)}`)
|
||||
return this.action('dm-hook', 'graph-update-2', {
|
||||
"add-nodes": {
|
||||
resource: { ship: `~${window.ship}`, name: 'inbox' },
|
||||
resource: { ship: `~${window.ship}`, name: 'dm-inbox' },
|
||||
nodes: {
|
||||
[post.index]: {
|
||||
post,
|
||||
|
@ -152,7 +152,7 @@ export function useGraphForAssoc(association: Association) {
|
||||
window.useGraphState = useGraphState;
|
||||
|
||||
export function useInbox() {
|
||||
return useGraphState(s => s.graphs[`${window.ship}/inbox`] || new BigIntOrderedMap());
|
||||
return useGraphState(s => s.graphs[`${window.ship}/dm-inbox`] || new BigIntOrderedMap());
|
||||
}
|
||||
|
||||
export function useDM(ship: string) {
|
||||
|
@ -69,7 +69,7 @@ const useHarkState = createState<HarkState>('Hark', {
|
||||
|
||||
export function useHarkDm(ship: string) {
|
||||
return useHarkState(useCallback(s => {
|
||||
return s.unreads.graph[`/ship/~${window.ship}/inbox`]?.[`/${patp2dec(ship)}`];
|
||||
return s.unreads.graph[`/ship/~${window.ship}/dm-inbox`]?.[`/${patp2dec(ship)}`];
|
||||
}, [ship]));
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,7 @@ class App extends React.Component {
|
||||
|
||||
componentDidMount() {
|
||||
this.subscription.start();
|
||||
this.api.graph.getShallowChildren(`~${window.ship}`, 'inbox');
|
||||
this.api.graph.getShallowChildren(`~${window.ship}`, 'dm-inbox');
|
||||
this.themeWatcher = window.matchMedia('(prefers-color-scheme: dark)');
|
||||
this.themeWatcher.onchange = this.updateTheme;
|
||||
setTimeout(() => {
|
||||
|
@ -18,7 +18,7 @@ interface DmResourceProps {
|
||||
|
||||
const getCurrDmSize = (ship: string) => {
|
||||
const { graphs } = useGraphState.getState();
|
||||
const graph = graphs[`${window.ship}/inbox`];
|
||||
const graph = graphs[`${window.ship}/dm-inbox`];
|
||||
if (!graph) {
|
||||
return 0;
|
||||
}
|
||||
@ -37,7 +37,7 @@ export function DmResource(props: DmResourceProps) {
|
||||
const nickname = showNickname ? contact!.nickname : cite(ship) ?? ship;
|
||||
|
||||
useEffect(() => {
|
||||
api.graph.getNewest(`~${window.ship}`, 'inbox', 100, `/${patpToUd(ship)}`);
|
||||
api.graph.getNewest(`~${window.ship}`, 'dm-inbox', 100, `/${patpToUd(ship)}`);
|
||||
}, [ship]);
|
||||
|
||||
const fetchMessages = useCallback(
|
||||
@ -51,9 +51,9 @@ export function DmResource(props: DmResourceProps) {
|
||||
}
|
||||
await api.graph.getYoungerSiblings(
|
||||
`~${window.ship}`,
|
||||
'inbox',
|
||||
'dm-inbox',
|
||||
pageSize,
|
||||
`/${patp2dec(ship)}/${index.toString()}`
|
||||
`/${patpToUd(ship)}/${index.toString()}`
|
||||
);
|
||||
return expectedSize !== getCurrDmSize(ship);
|
||||
} else {
|
||||
@ -63,9 +63,9 @@ export function DmResource(props: DmResourceProps) {
|
||||
}
|
||||
await api.graph.getOlderSiblings(
|
||||
`~${window.ship}`,
|
||||
'inbox',
|
||||
'dm-inbox',
|
||||
pageSize,
|
||||
`/${patp2dec(ship)}/${index.toString()}`
|
||||
`/${patpToUd(ship)}/${index.toString()}`
|
||||
);
|
||||
return expectedSize !== getCurrDmSize(ship);
|
||||
}
|
||||
@ -74,7 +74,7 @@ export function DmResource(props: DmResourceProps) {
|
||||
);
|
||||
|
||||
const dismissUnread = useCallback(() => {
|
||||
api.hark.dismissReadCount(`/ship/~${window.ship}/inbox`, `/${patp2dec(ship)}`);
|
||||
api.hark.dismissReadCount(`/ship/~${window.ship}/dm-inbox`, `/${patpToUd(ship)}`);
|
||||
}, [ship]);
|
||||
|
||||
|
||||
|
@ -86,7 +86,7 @@ export function SidebarList(props: {
|
||||
const { selected, group, config, workspace } = props;
|
||||
const associations = useMetadataState(state => state.associations);
|
||||
const inbox = useInbox();
|
||||
const unreads = useHarkState(s => s.unreads.graph?.[`/ship/~${window.ship}/inbox`]);
|
||||
const unreads = useHarkState(s => s.unreads.graph?.[`/ship/~${window.ship}/dm-inbox`]);
|
||||
|
||||
|
||||
const ordered = getItems(associations, workspace, inbox)
|
||||
|
Loading…
Reference in New Issue
Block a user