i forgot this 💀
This commit is contained in:
parent
cc2a0f284a
commit
72157f689b
1 changed files with 0 additions and 28 deletions
|
|
@ -1,41 +1,13 @@
|
|||
import Navbar from '@/components/Navbar';
|
||||
import useNotifications from '@/hooks/useNotification';
|
||||
import { bindings } from '@/main';
|
||||
import { AnimatedOutlet } from '@onelauncher/common/components';
|
||||
import { createFileRoute } from '@tanstack/react-router';
|
||||
import { OverlayScrollbarsComponent } from 'overlayscrollbars-react';
|
||||
import { useEffect } from 'react';
|
||||
|
||||
export const Route = createFileRoute('/app')({
|
||||
component: RouteComponent,
|
||||
});
|
||||
|
||||
function RouteComponent() {
|
||||
const { set, remove } = useNotifications();
|
||||
|
||||
useEffect(() => {
|
||||
let unlisten: (() => void) | undefined;
|
||||
(async () => {
|
||||
unlisten = await bindings.events.ingress.on((e) => {
|
||||
if (typeof e.ingress_type === 'object')
|
||||
if ('PrepareCluster' in e.ingress_type) {
|
||||
const { cluster_name } = e.ingress_type.PrepareCluster;
|
||||
let id = `cluster-${cluster_name}`;
|
||||
|
||||
set(id, {
|
||||
title: 'Preparing Cluster',
|
||||
message: e.message,
|
||||
});
|
||||
|
||||
if (e.percent === e.total)
|
||||
remove(id);
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
return () => unlisten?.();
|
||||
}, [set, remove]);
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="flex flex-col px-4">
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue