Skip to content

Commit

Permalink
Merge branch 'main' into fix/transfer-uppercase
Browse files Browse the repository at this point in the history
  • Loading branch information
bal7hazar authored Dec 21, 2024
2 parents cb5fc9e + 69f5a1c commit 275cca3
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 8 deletions.
6 changes: 4 additions & 2 deletions packages/keychain/src/components/ExecutionContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export function ExecutionContainer({
);

useEffect(() => {
if (!!ctrlError || maxFee !== null || !transactions.length) {
if (!!ctrlError || maxFee !== null || !transactions?.length) {
return;
}

Expand Down Expand Up @@ -200,7 +200,9 @@ export function ExecutionContainer({
colorScheme="colorful"
onClick={handleSubmit}
isLoading={isLoading}
isDisabled={maxFee === null && transactions.length}
isDisabled={
!transactions || (maxFee === null && transactions?.length)
}
>
{buttonText}
</Button>
Expand Down
3 changes: 2 additions & 1 deletion packages/keychain/src/components/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Session } from "./session";
import { Failure } from "./failure";
import { Success } from "./success";
import { Pending } from "./pending";
import { Slot } from "./slot";
import { Consent, Slot } from "./slot";

export function App() {
return (
Expand All @@ -14,6 +14,7 @@ export function App() {
<Route path="authenticate" element={<Authenticate />} />
<Route path="session" element={<Session />} />
<Route path="slot" element={<Slot />} />
<Route path="slot/consent" element={<Consent />} />
<Route path="success" element={<Success />} />
<Route path="failure" element={<Failure />} />
<Route path="pending" element={<Pending />} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export function RegisterSession({

const onRegisterSession = useCallback(
async (maxFee?: bigint) => {
if (!maxFee || !publicKey || !controller) {
if (maxFee == undefined || !publicKey || !controller) {
return;
}

Expand Down
7 changes: 5 additions & 2 deletions packages/keychain/src/components/session.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ export function Session() {
const url = sanitizeCallbackUrl(
decodeURIComponent(queries.callback_uri),
);
if (!url) return;
if (!url) {
return;
}

const res = await fetch(url, {
body: encodedResponse,
headers,
Expand Down Expand Up @@ -99,7 +102,7 @@ export function Session() {
if (queries.redirect_uri) {
const url = decodeURIComponent(queries.redirect_uri);
const query_name = queries.redirect_query_name ?? "session";
navigate(`${url}?${query_name}=${encodedResponse}`, { replace: true });
window.location.href = `${url}?${query_name}=${encodedResponse}`;
}
},
[navigate, queries],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function UnverifiedSessionSummary({
);
})}

{policies.messages?.length && (
{policies.messages && policies.messages.length > 0 && (
<MessageCard messages={policies.messages} />
)}
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/keychain/src/components/slot/consent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function Consent() {

useEffect(() => {
if (!Controller.fromStore(import.meta.env.VITE_ORIGIN!)) {
navigate("/slot", { replace: true });
navigate("/slot/auth", { replace: true });
}
}, [navigate]);

Expand Down

0 comments on commit 275cca3

Please sign in to comment.