Skip to content

Commit

Permalink
better Continue to Cap button
Browse files Browse the repository at this point in the history
  • Loading branch information
Brendonovich committed Nov 4, 2024
1 parent 33f2703 commit b9ada80
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions apps/desktop/src/routes/(window-chrome)/permissions.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
import { Button } from "@cap/ui-solid";
import type { RouteSectionProps } from "@solidjs/router";
import { commands, OSPermission, type OSPermissionStatus } from "~/utils/tauri";
import {
createEffect,
createResource,
Suspense,
createSignal,
Show,
For,
startTransition,
} from "solid-js";
import { createTimer } from "@solid-primitives/timer";
import { getCurrentWindow } from "@tauri-apps/api/window";
import { Transition } from "solid-transition-group";

import Header from "../../components/Header";
import { commands, OSPermission, type OSPermissionStatus } from "~/utils/tauri";

function isPermitted(status?: OSPermissionStatus): boolean {
return status === "granted" || status === "notNeeded";
Expand Down Expand Up @@ -66,7 +62,7 @@ export default function () {
};

return (
<div class="flex flex-col p-[1rem] text-[0.875rem] font-[400] flex-1 bg-gray-100 justify-between">
<div class="flex flex-col p-[1rem] text-[0.875rem] font-[400] flex-1 bg-gray-100 justify-between items-center">
<div class="flex flex-col items-center">
<IconCapLogo class="size-16 mb-1" />
<h1 class="text-[1rem] font-[700] mb-0.5">Permissions Required</h1>
Expand Down Expand Up @@ -110,14 +106,14 @@ export default function () {
</ul>

<Button
class="px-12"
size="lg"
disabled={
permissions.find((p) => !isPermitted(check()?.[p.key])) !== undefined
}
onClick={() => {
startTransition(() => {
commands.openMainWindow().then(() => {
getCurrentWindow().close();
});
commands.openMainWindow().then(() => {
getCurrentWindow().close();
});
}}
>
Expand Down

0 comments on commit b9ada80

Please sign in to comment.