mirror of
https://github.com/XFox111/TabsAsideExtension.git
synced 2026-07-02 19:52:47 +03:00
26 lines
581 B
TypeScript
26 lines
581 B
TypeScript
import { DialogContextType } from "@/contexts/DialogProvider";
|
|
import WelcomeDialog from "../components/WelcomeDialog";
|
|
import { showWelcomeDialog } from "../utils/showWelcomeDialog";
|
|
|
|
export default function useWelcomeDialog(dialog: DialogContextType): Promise<void>
|
|
{
|
|
return new Promise<void>(res =>
|
|
{
|
|
showWelcomeDialog.getValue().then(showWelcome =>
|
|
{
|
|
if (showWelcome || import.meta.env.DEV)
|
|
dialog.pushCustom(
|
|
<WelcomeDialog />,
|
|
"alert",
|
|
() =>
|
|
{
|
|
showWelcomeDialog.removeValue();
|
|
res();
|
|
}
|
|
);
|
|
else
|
|
res();
|
|
});
|
|
});
|
|
}
|