Skip to content

Commit

Permalink
fixup for signals
Browse files Browse the repository at this point in the history
skipLibCheck is needed for an error in `solid-start` which is used by the storage primitives
  • Loading branch information
dni committed Jan 3, 2024
1 parent d36d760 commit 2fce733
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 17 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"testnet": "cp src/configs/config.testnet.ts src/config.ts; vite build; cp dist/index.html dist/404.html",
"prettier": "prettier --write src tests",
"prettier-check": "prettier --check src tests",
"tsc": "tsc",
"tsc": "tsc --skipLibCheck",
"changelog": "git-cliff -o CHANGELOG.md"
},
"devDependencies": {
Expand Down
14 changes: 3 additions & 11 deletions src/components/CreateButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,7 @@ export const CreateButton = () => {
const [buttonClass, setButtonClass] = createSignal("btn");

const validateButtonDisable = () => {
return (
!valid() &&
!(lnurl() !== "" && lnurl() !== false && sendAmountValid())
);
return !valid() && !(lnurl() !== "" && sendAmountValid());
};

createEffect(() => {
Expand Down Expand Up @@ -85,16 +82,11 @@ export const CreateButton = () => {
});

const create = async () => {
if (
sendAmountValid() &&
!reverse() &&
lnurl() !== "" &&
lnurl() !== false
) {
if (sendAmountValid() && !reverse() && lnurl() !== "") {
try {
const inv = await fetchLnurl(lnurl(), Number(receiveAmount()));
setInvoice(inv);
setLnurl(false);
setLnurl("");
} catch (e) {
setNotificationType("error");
setNotification(e);
Expand Down
6 changes: 3 additions & 3 deletions src/components/InvoiceInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ const InvoiceInput = () => {
setLnurl(inputValue);
} else {
const sats = validateInvoice(inputValue);
setReceiveAmount(sats);
setReceiveAmount(BigInt(sats));
setSendAmount(calculateSendAmount(sats));
setInvoice(inputValue);
setLnurl(false);
setLnurl("");
setInvoiceValid(true);
}
input.setCustomValidity("");
input.classList.remove("invalid");
} catch (e) {
setInvoiceValid(false);
setLnurl(false);
setLnurl("");
input.setCustomValidity(t(e.message));
setButtonLabel({ key: e.message });
input.classList.add("invalid");
Expand Down
4 changes: 2 additions & 2 deletions tests/components/InvoiceInput.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ describe("InvoiceInput", () => {
expect(setInvoice).toHaveBeenCalledTimes(1);
expect(setInvoice).toHaveBeenCalledWith(invoice);

setReceiveAmount(receiveAmount() + 1);
setReceiveAmount(receiveAmount() + 1n);

expect(setInvoice).toHaveBeenCalledTimes(2);
expect(setInvoice).toHaveBeenCalledWith("");
Expand Down Expand Up @@ -102,7 +102,7 @@ describe("InvoiceInput", () => {
expect(setLnurl).toHaveBeenCalledTimes(1);
expect(setLnurl).toHaveBeenCalledWith(lnurl.toLowerCase());

setSendAmount(sendAmount() + 1);
setSendAmount(sendAmount() + 1n);

expect(input.value).toEqual(lnurl);
});
Expand Down

0 comments on commit 2fce733

Please sign in to comment.