mirror of
https://github.com/urbit/shrub.git
synced 2024-12-19 00:13:12 +03:00
grid: dismiss Base Blocked notice on Archive
This commit is contained in:
parent
d3474705a9
commit
ae0febc832
@ -13,7 +13,7 @@ function renderNotification(notification: Notification, key: string, lid: HarkLi
|
||||
return <RuntimeLagNotification key={key} />;
|
||||
}
|
||||
if (notification.bin.path === '/blocked' && notification.bin.place.path === '/desk/base') {
|
||||
return <BaseBlockedNotification key={key} />;
|
||||
return <BaseBlockedNotification key={key} bin={notification.bin} lid={lid} />;
|
||||
}
|
||||
if (notification.bin.place.path === '/onboard') {
|
||||
return <OnboardingNotification key={key} lid={lid} />;
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { pick, partition } from 'lodash';
|
||||
import React, { useCallback } from 'react';
|
||||
import { kilnBump, Pike } from '@urbit/api';
|
||||
import { HarkBin, HarkLid, kilnBump, Pike } from '@urbit/api';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { AppList } from '../../components/AppList';
|
||||
import { Button } from '../../components/Button';
|
||||
@ -12,6 +12,7 @@ import useKilnState, { usePike } from '../../state/kiln';
|
||||
|
||||
import { NotificationButton } from './NotificationButton';
|
||||
import { disableDefault } from '../../state/util';
|
||||
import { useHarkStore } from '../../state/hark';
|
||||
|
||||
export const RuntimeLagNotification = () => (
|
||||
<section
|
||||
@ -41,7 +42,7 @@ function pikeIsBlocked(newKelvin: number, pike: Pike) {
|
||||
return !pike.wefts?.find(({ kelvin }) => kelvin === newKelvin);
|
||||
}
|
||||
|
||||
export const BaseBlockedNotification = () => {
|
||||
export const BaseBlockedNotification = ({ bin, lid }: { bin: HarkBin, lid: HarkLid }) => {
|
||||
const basePike = usePike('base');
|
||||
const { push } = useHistory();
|
||||
// TODO: assert weft.name === 'zuse'??
|
||||
@ -68,6 +69,8 @@ export const BaseBlockedNotification = () => {
|
||||
|
||||
const handleArchiveApps = useCallback(async () => {
|
||||
await api.poke(kilnBump());
|
||||
await useHarkStore.getState().archiveNote(bin, lid);
|
||||
|
||||
push('/leap/upgrading');
|
||||
}, []);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user