Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions kinode/packages/app_store/app_store/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,8 @@ pub fn new_package(

let download_resp = serde_json::from_slice::<DownloadResponses>(&resp.body())?;

match download_resp {
DownloadResponses::Error(e) => {
return Err(anyhow::anyhow!("failed to add download: {:?}", e));
}
_ => {}
if let DownloadResponses::Error(e) = download_resp {
return Err(anyhow::anyhow!("failed to add download: {:?}", e));
}
Ok(())
}
Expand Down
12 changes: 6 additions & 6 deletions kinode/src/register-ui/src/components/EnterKnsName.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ function EnterKnsName({
let validities: string[] = [];
setIsPunyfied('');

const len = [...name].length;
index = validities.indexOf(NAME_LENGTH);
if (len < 9 && len !== 0) {
if (index === -1) validities.push(NAME_LENGTH);
} else if (index !== -1) validities.splice(index, 1);

let normalized = ''
index = validities.indexOf(NAME_INVALID_PUNY);
try {
Expand All @@ -62,6 +56,12 @@ function EnterKnsName({
if (index === -1) validities.push(NAME_INVALID_PUNY);
}

const len = [...normalized].length - 3;
index = validities.indexOf(NAME_LENGTH);
if (len < 9 && len !== 0) {
if (index === -1) validities.push(NAME_LENGTH);
} else if (index !== -1) validities.splice(index, 1);

if (normalized !== (name + ".os")) setIsPunyfied(normalized);

// only check if name is valid punycode
Expand Down
4 changes: 3 additions & 1 deletion kinode/src/register-ui/src/pages/CommitDotOsName.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useState, useEffect, FormEvent, useCallback } from "react";
import { Link, useNavigate } from "react-router-dom";
import { toAscii } from "idna-uts46-hx";
import EnterKnsName from "../components/EnterKnsName";
import Loader from "../components/Loader";
import { PageProps } from "../lib/types";
Expand Down Expand Up @@ -66,6 +67,7 @@ function CommitDotOsName({
openConnectModal?.()
return
}
setName(toAscii(name));
console.log("committing to .os name: ", name)
const commitSecret = keccak256(stringToHex(name))
const commit = keccak256(
Expand Down Expand Up @@ -134,4 +136,4 @@ function CommitDotOsName({
);
}

export default CommitDotOsName;
export default CommitDotOsName;