Skip to content

Commit

Permalink
call npm run format, add format github action
Browse files Browse the repository at this point in the history
  • Loading branch information
prusnak committed Oct 14, 2024
1 parent c43001b commit ccc1022
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 30 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/format.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Check format

on: [push, pull_request]

jobs:
format-check:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Install dependencies
run: npm install

- name: Run format check
run: npm run format
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
Cashu Wallet

## One-liner build & run

```
docker-compose up -d
```

access at http://localhost:3000 or serve it behind a reverse proxy.

## Install the dependencies
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
version: '2'
version: "2"
services:
cashu.me:
image: cashu.me
build: .
container_name: cashu.me
restart: always
ports:
- "127.0.0.1:3000:80"
- "127.0.0.1:3000:80"
19 changes: 18 additions & 1 deletion src-capacitor/android/app/debug/output.json
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"1.0","enabled":true,"outputFile":"app-debug.apk","fullName":"debug","baseName":"debug","dirName":""},"path":"app-debug.apk","properties":{}}]
[
{
"outputType": { "type": "APK" },
"apkData": {
"type": "MAIN",
"splits": [],
"versionCode": 1,
"versionName": "1.0",
"enabled": true,
"outputFile": "app-debug.apk",
"fullName": "debug",
"baseName": "debug",
"dirName": ""
},
"path": "app-debug.apk",
"properties": {}
}
]
12 changes: 8 additions & 4 deletions src/components/BalanceView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,21 @@
<!-- <q-card class="q-my-md q-py-sm">
<q-card-section class="q-mt-sm q-py-xs"> -->
<div class="q-pt-xl q-pb-md">
<div class="row justify-center q-pb-lg" style="height:80px">
<div class="row justify-center q-pb-lg" style="height: 80px">
<div v-if="globalMutexLock">
<transition
appear
enter-active-class="animated fadeIn"
leave-active-class="animated fadeOut"
>
<q-spinner-hourglass class="q-mt-lg q-mb-none" size="lg" color="primary" />
</transition>
<q-spinner-hourglass
class="q-mt-lg q-mb-none"
size="lg"
color="primary"
/>
</transition>
</div>
<div v-else >
<div v-else>
<transition
appear
enter-active-class="animated fadeIn"
Expand Down
16 changes: 10 additions & 6 deletions src/components/InvoiceDetailDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@
: 'Create Invoice'
"
:loading="globalMutexLock"
>
<template v-slot:loading>
<q-spinner-hourglass />
Creating
</template>
>
<template v-slot:loading>
<q-spinner-hourglass />
Creating
</template>
</q-btn>
<q-btn v-close-popup rounded flat color="grey" class="q-ml-auto"
>Close</q-btn
Expand Down Expand Up @@ -175,7 +175,11 @@ export default defineComponent({
...mapState(useWalletStore, ["invoiceData"]),
...mapState(useMintsStore, ["activeUnit", "activeUnitLabel"]),
...mapState(useWorkersStore, ["invoiceWorkerRunning"]),
...mapWritableState(useUiStore, ["showInvoiceDetails", "tickerShort", "globalMutexLock"]),
...mapWritableState(useUiStore, [
"showInvoiceDetails",
"tickerShort",
"globalMutexLock",
]),
displayUnit: function () {
let display = this.formatCurrency(
this.invoiceData.amount,
Expand Down
37 changes: 20 additions & 17 deletions src/components/SendTokenDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,7 @@
<template v-slot:loading>
<q-spinner-hourglass />
</template>
</q-btn
>
</q-btn>
<div
v-if="sendData.p2pkPubkey && isValidPubkey(sendData.p2pkPubkey)"
class="row"
Expand Down Expand Up @@ -236,12 +235,12 @@
Size: {{ fragmentLengthLabel }}
</q-btn>
<q-badge
:color="!isV4Token ? 'primary' : 'grey'"
:label="isV4Token ? 'V4' : 'V3'"
class="q-my-sm q-mx-md cursor-pointer"
@click="toggleTokenEncoding"
:outline="isV4Token"
/>
:color="!isV4Token ? 'primary' : 'grey'"
:label="isV4Token ? 'V4' : 'V3'"
class="q-my-sm q-mx-md cursor-pointer"
@click="toggleTokenEncoding"
:outline="isV4Token"
/>
</div>
<q-card-section class="q-pa-sm">
<div class="row justify-center">
Expand Down Expand Up @@ -356,7 +355,11 @@ import { Buffer } from "buffer";
import { useCameraStore } from "src/stores/camera";
import { useP2PKStore } from "src/stores/p2pk";
import TokenInformation from "components/TokenInformation.vue";
import { getDecodedToken, getEncodedTokenV4, getEncodedToken } from "@cashu/cashu-ts";
import {
getDecodedToken,
getEncodedTokenV4,
getEncodedToken,
} from "@cashu/cashu-ts";
import { mapActions, mapState, mapWritableState } from "pinia";
import ChooseMint from "components/ChooseMint.vue";
Expand Down Expand Up @@ -403,7 +406,11 @@ export default defineComponent({
]),
...mapWritableState(useSendTokensStore, ["sendData"]),
...mapWritableState(useCameraStore, ["camera", "hasCamera"]),
...mapState(useUiStore, ["tickerShort", "canPasteFromClipboard", "globalMutexLock"]),
...mapState(useUiStore, [
"tickerShort",
"canPasteFromClipboard",
"globalMutexLock",
]),
...mapState(useMintsStore, [
"activeProofs",
"activeUnit",
Expand Down Expand Up @@ -596,17 +603,13 @@ export default defineComponent({
// if it starts with 'cashuB', it is a v4 token
if (this.sendData.tokensBase64.startsWith("cashuA")) {
try {
this.sendData.tokensBase64 = getEncodedTokenV4(decodedToken)
this.sendData.tokensBase64 = getEncodedTokenV4(decodedToken);
} catch {
console.log("### Could not encode token to V4");
this.sendData.tokensBase64 = getEncodedToken(
decodedToken
);
this.sendData.tokensBase64 = getEncodedToken(decodedToken);
}
} else {
this.sendData.tokensBase64 = getEncodedToken(
decodedToken
);
this.sendData.tokensBase64 = getEncodedToken(decodedToken);
}
},
deleteThisToken: function () {
Expand Down

0 comments on commit ccc1022

Please sign in to comment.