diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 525246b101..549e117ace 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -183,6 +183,8 @@ jobs: (cd $GOPATH/$GO_SRC_DIR; make ios) windows: runs-on: windows-2019 + outputs: + artifact-url: ${{ steps.upload.outputs.artifact-url }} defaults: run: shell: bash @@ -221,10 +223,12 @@ jobs: cd frontends/qt makensis setup.nsi - name: Upload Installer + id: upload uses: actions/upload-artifact@v4 with: path: frontends/qt/BitBox-installer.exe - name: BitBoxApp-Windows-${{ github.sha }}.exe + name: BitBoxApp-windows-${{ github.sha }}.exe + if-no-files-found: error report-artifacts: needs: [android, qt-linux, macos, windows] diff --git a/CHANGELOG.md b/CHANGELOG.md index f3899f00c7..b214c37d8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ - Fix long transaction notes to show fully on multiple lines when necessary - Improve send-to-self transactions in account overview - Use native scrollbars on macOS, iOS and Android +- Fix address signing fail on screen rotation for Pocket and Bitsurance +- Restrict selection to text files when importing notes # 4.46.3 - Fix camera access on linux diff --git a/frontends/android/BitBoxApp/app/src/main/java/ch/shiftcrypto/bitboxapp/MainActivity.java b/frontends/android/BitBoxApp/app/src/main/java/ch/shiftcrypto/bitboxapp/MainActivity.java index b08aaf75dd..1ce7e7bf6b 100644 --- a/frontends/android/BitBoxApp/app/src/main/java/ch/shiftcrypto/bitboxapp/MainActivity.java +++ b/frontends/android/BitBoxApp/app/src/main/java/ch/shiftcrypto/bitboxapp/MainActivity.java @@ -332,7 +332,17 @@ public void onActivityResult(Uri uri) { @Override public boolean onShowFileChooser(WebView webView, ValueCallback filePathCallback, FileChooserParams fileChooserParams) { MainActivity.this.filePathCallback = filePathCallback; - mGetContent.launch("*/*"); + String[] mimeTypes = fileChooserParams.getAcceptTypes(); + String fileType = "*/*"; + if (mimeTypes.length == 1) { + // import notes form uses .txt file type, but is not supported here. + if (".txt".equals(mimeTypes[0])) { + fileType = "text/plain"; + } else if (MimeTypeMap.getSingleton().hasMimeType(mimeTypes[0])) { + fileType = mimeTypes[0]; + } + } + mGetContent.launch(fileType); return true; } }); diff --git a/frontends/web/.eslintrc.json b/frontends/web/.eslintrc.json index 1fdeb8e2ad..881e982850 100644 --- a/frontends/web/.eslintrc.json +++ b/frontends/web/.eslintrc.json @@ -57,7 +57,17 @@ "overrides": [ { "files": ["**/*.ts?(x)"], - "rules": { } + "rules": { + "@typescript-eslint/restrict-template-expressions": ["error", { + "allowNumber": true, + "allowAny": false, + "allowBoolean": false, + "allowNullish": false + }] + }, + "parserOptions": { + "project": ["./tsconfig.json"] + } }, { "files": ["**/*.test.ts?(x)"], diff --git a/frontends/web/src/api/account.ts b/frontends/web/src/api/account.ts index b6b5958f5d..303015340f 100644 --- a/frontends/web/src/api/account.ts +++ b/frontends/web/src/api/account.ts @@ -65,7 +65,7 @@ export interface IAccount { active: boolean; watch: boolean; coinCode: CoinCode; - coinUnit: string; + coinUnit: CoinUnit; coinName: string; code: AccountCode; name: string; diff --git a/frontends/web/src/api/bitbox01.ts b/frontends/web/src/api/bitbox01.ts index 48db306ad3..e95f1158d2 100644 --- a/frontends/web/src/api/bitbox01.ts +++ b/frontends/web/src/api/bitbox01.ts @@ -34,6 +34,6 @@ export type DeviceInfo = { export const getDeviceInfo = ( deviceID: string, -): Promise => { +): Promise => { return apiGet(`devices/${deviceID}/info`); }; diff --git a/frontends/web/src/api/subscribe.ts b/frontends/web/src/api/subscribe.ts index 59122cf557..602a893c23 100644 --- a/frontends/web/src/api/subscribe.ts +++ b/frontends/web/src/api/subscribe.ts @@ -42,7 +42,7 @@ export const subscribeEndpoint = ( .catch(console.error); break; default: - throw new Error(`Event: ${event} not supported`); + throw new Error(`Event: ${JSON.stringify(event)} not supported`); } }); }; diff --git a/frontends/web/src/components/forms/select.tsx b/frontends/web/src/components/forms/select.tsx index 6e7e22269f..43ec5d09e6 100644 --- a/frontends/web/src/components/forms/select.tsx +++ b/frontends/web/src/components/forms/select.tsx @@ -41,7 +41,7 @@ export const Select = ({ diff --git a/frontends/web/src/routes/settings/components/appearance/defaultCurrencyDropdownSetting.tsx b/frontends/web/src/routes/settings/components/appearance/defaultCurrencyDropdownSetting.tsx index b06f19f13b..c285c2378a 100644 --- a/frontends/web/src/routes/settings/components/appearance/defaultCurrencyDropdownSetting.tsx +++ b/frontends/web/src/routes/settings/components/appearance/defaultCurrencyDropdownSetting.tsx @@ -28,7 +28,8 @@ export const DefaultCurrencyDropdownSetting = () => { const { formattedCurrencies, currenciesWithDisplayName } = useLocalizedFormattedCurrencies(i18n.language); const { addToActiveCurrencies, updateDefaultCurrency, defaultCurrency, activeCurrencies } = useContext(RatesContext); const valueLabel = currenciesWithDisplayName.find(fiat => fiat.currency === defaultCurrency)?.displayName; - const defaultValueLabel = valueLabel ? `${currencyName.of(defaultCurrency)} (${defaultCurrency})` : defaultCurrency; + const currencyNameOfDefaultCurrency = currencyName.of(defaultCurrency) || ''; + const defaultValueLabel = valueLabel ? `${currencyNameOfDefaultCurrency} (${defaultCurrency})` : defaultCurrency; return ( { settingName={
{globe}{t('newSettings.appearance.language.title')}
} secondaryText={t('newSettings.appearance.language.description')} collapseOnSmall - title={`Detected native locale: ${nativeLocale}`} + title={nativeLocale && `Detected native locale: ${nativeLocale}`} extraComponent={ { type="file" className={style.fileInput} ref={fileInputRef} - accept="text/*,.txt" + accept=".txt" onChange={async (e: React.ChangeEvent) => { setImportDisabled(e.target.files === null || e.target.files.length === 0); if (fileInputRef.current === null) { diff --git a/frontends/web/src/routes/settings/components/device-settings/attestation-check-setting.tsx b/frontends/web/src/routes/settings/components/device-settings/attestation-check-setting.tsx index 47af3555b6..d6863edf84 100644 --- a/frontends/web/src/routes/settings/components/device-settings/attestation-check-setting.tsx +++ b/frontends/web/src/routes/settings/components/device-settings/attestation-check-setting.tsx @@ -44,7 +44,7 @@ const AttestationCheckSetting = ({ deviceID }: TProps) => { settingName={t('deviceSettings.hardware.attestation.label')} secondaryText={t('deviceSettings.deviceInformation.attestation.description')} extraComponent={icon} - displayedValue={t(`deviceSettings.hardware.attestation.${attestation}`)} + displayedValue={t(`deviceSettings.hardware.attestation.${attestation ? 'true' : 'false'}`)} hideDisplayedValueOnSmall /> );