diff --git a/android/app/build.gradle b/android/app/build.gradle index ad85ea3f..e064e3b9 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -7,8 +7,8 @@ android { applicationId "com.mutinywallet.mutinywallet" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 73 - versionName "1.7.12" + versionCode 74 + versionName "1.7.13" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" aaptOptions { // Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps. diff --git a/ios/App/App.xcodeproj/project.pbxproj b/ios/App/App.xcodeproj/project.pbxproj index c888c747..c11d5ec4 100644 --- a/ios/App/App.xcodeproj/project.pbxproj +++ b/ios/App/App.xcodeproj/project.pbxproj @@ -360,7 +360,7 @@ INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.finance"; IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 1.7.12; + MARKETING_VERSION = 1.7.13; OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\""; PRODUCT_BUNDLE_IDENTIFIER = "com.mutinywallet.mutiny-test"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -387,7 +387,7 @@ INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.finance"; IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 1.7.12; + MARKETING_VERSION = 1.7.13; PRODUCT_BUNDLE_IDENTIFIER = com.mutinywallet.mutiny; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/package.json b/package.json index fe10e5da..f949f8cd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mutiny-wallet", - "version": "1.7.12", + "version": "1.7.13", "license": "MIT", "packageManager": "pnpm@8.6.6", "scripts": { @@ -56,7 +56,7 @@ "@kobalte/core": "^0.12.6", "@kobalte/tailwindcss": "^0.9.0", "@modular-forms/solid": "^0.20.0", - "@mutinywallet/mutiny-wasm": "1.7.11", + "@mutinywallet/mutiny-wasm": "1.7.12", "@sentry/browser": "^8.7.0", "@sentry/vite-plugin": "^2.18.0", "@solid-primitives/upload": "^0.0.117", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 695f08ba..ebc03500 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -54,8 +54,8 @@ dependencies: specifier: ^0.20.0 version: 0.20.0(solid-js@1.8.16) '@mutinywallet/mutiny-wasm': - specifier: 1.7.11 - version: 1.7.11 + specifier: 1.7.12 + version: 1.7.12 '@sentry/browser': specifier: ^8.7.0 version: 8.7.0 @@ -2177,8 +2177,8 @@ packages: solid-js: 1.8.16 dev: false - /@mutinywallet/mutiny-wasm@1.7.11: - resolution: {integrity: sha512-fHVPUbwMGxmTWJVfyLmdEUsNAGzYD6bi6D8bgMuRLq6gvw8Uq/KNImiZnj3fU4Fb/siYRlLMJa+uyB5wJrvXkQ==} + /@mutinywallet/mutiny-wasm@1.7.12: + resolution: {integrity: sha512-FbYZXkWb4R3PAzLI0k+w5c16G4pY33uIyFcp3FErM0xxU5OLRmZXz6DPZtCWVzrVkvXAZmceBHu4pYaELhv84w==} dev: false /@nodelib/fs.scandir@2.1.5: @@ -7854,6 +7854,7 @@ packages: /workbox-google-analytics@7.0.0: resolution: {integrity: sha512-MEYM1JTn/qiC3DbpvP2BVhyIH+dV/5BjHk756u9VbwuAhu0QHyKscTnisQuz21lfRpOwiS9z4XdqeVAKol0bzg==} + deprecated: It is not compatible with newer versions of GA starting with v4, as long as you are using GAv3 it should be ok, but the package is not longer being maintained dependencies: workbox-background-sync: 7.0.0 workbox-core: 7.0.0 diff --git a/public/i18n/en.json b/public/i18n/en.json index 8994bbd1..ad4432f6 100644 --- a/public/i18n/en.json +++ b/public/i18n/en.json @@ -40,10 +40,7 @@ "just_me": "Just Me", "friends": "Friends", "requests": "Requests" - }, - "federations_warn_generic": "Due to temporary issues with your current federation, we recommend you transfer your funds to a lightning channel or withdraw to another bitcoin wallet.", - "transfer_lightning": "Transfer to lightning", - "sent_to_another_wallet": "Send to another wallet" + } }, "profile": { "profile": "Profile", @@ -52,7 +49,6 @@ "edit_profile": "Edit Profile", "join_federation": "Join a federation", "manage_federation": "Manage Federations", - "leave_federation": "Leave Federation", "federated_custody": "Federated Custody", "self_custody": "Self Custody", "social": "Social", diff --git a/src/components/Activity.tsx b/src/components/Activity.tsx index 588a7d4e..e9781991 100644 --- a/src/components/Activity.tsx +++ b/src/components/Activity.tsx @@ -1,6 +1,6 @@ import { TagItem } from "@mutinywallet/mutiny-wasm"; import { cache, createAsync, useNavigate } from "@solidjs/router"; -import { Plus, Save, Search, Shuffle } from "lucide-solid"; +import { Plus, Save, Search, Shuffle, Users } from "lucide-solid"; import { createEffect, createMemo, diff --git a/src/components/FederationPopup.tsx b/src/components/FederationPopup.tsx index 074259d0..44d46516 100644 --- a/src/components/FederationPopup.tsx +++ b/src/components/FederationPopup.tsx @@ -1,13 +1,8 @@ import { useNavigate } from "@solidjs/router"; -import { ArrowLeftRight, ArrowUpRight, Users } from "lucide-solid"; -import { createSignal, Show } from "solid-js"; +import { Users } from "lucide-solid"; +import { createSignal } from "solid-js"; -import { - ButtonCard, - ExternalLink, - NiceP, - SimpleDialog -} from "~/components/layout"; +import { ButtonCard, NiceP, SimpleDialog } from "~/components/layout"; import { useI18n } from "~/i18n/context"; import { useMegaStore } from "~/state/megaStore"; @@ -21,11 +16,9 @@ export function FederationPopup() { const i18n = useI18n(); const navigate = useNavigate(); - const name = state.expiration_warning?.federationName; - return ( { if (!open) { @@ -34,41 +27,7 @@ export function FederationPopup() { } }} > - - {state.expiration_warning?.expiresMessage || - i18n.t("home.federations_warn_generic")} - - - - - {i18n.t("settings.manage_federations.learn_more")} - - - - { - actions.clearExpirationWarning(); - setShowFederationExpirationWarning(false); - navigate("/swaplightning"); - }} - > -
- - {i18n.t("home.transfer_lightning")} -
-
- { - actions.clearExpirationWarning(); - setShowFederationExpirationWarning(false); - navigate("/send"); - }} - > -
- - {i18n.t("home.sent_to_another_wallet")} -
-
+ {state.expiration_warning?.expiresMessage} { actions.clearExpirationWarning(); @@ -78,7 +37,7 @@ export function FederationPopup() { >
- {i18n.t("profile.leave_federation")} + {i18n.t("profile.manage_federation")}
diff --git a/src/routes/settings/ManageFederations.tsx b/src/routes/settings/ManageFederations.tsx index 24b529cb..87dfca6b 100644 --- a/src/routes/settings/ManageFederations.tsx +++ b/src/routes/settings/ManageFederations.tsx @@ -7,7 +7,7 @@ import { } from "@modular-forms/solid"; import { FederationBalance, TagItem } from "@mutinywallet/mutiny-wasm"; import { A, useNavigate, useSearchParams } from "@solidjs/router"; -import { BadgeCheck, LogOut, Scan, Trash } from "lucide-solid"; +import { ArrowLeftRight, BadgeCheck, LogOut, Scan, Trash } from "lucide-solid"; import { createResource, createSignal, @@ -152,8 +152,6 @@ export function AddFederationForm(props: { setSuccess( i18n.t("settings.manage_federations.federation_added_success") ); - // Reset the expiration warning seen state - actions.resetExpirationWarning(); await actions.refreshFederations(); if (props.refetch) { await props.refetch(); @@ -305,7 +303,8 @@ function FederationListItem(props: { balance?: bigint; }) { const i18n = useI18n(); - const [_state, actions, sw] = useMegaStore(); + const [state, actions, sw] = useMegaStore(); + const navigate = useNavigate(); async function removeFederation() { setConfirmLoading(true); @@ -324,6 +323,15 @@ function FederationListItem(props: { const [transferDialogOpen, setTransferDialogOpen] = createSignal(false); + async function transferFunds() { + // If there's only one federation we need to let them know to add another + if (state.federations?.length && state.federations.length < 2) { + setTransferDialogOpen(true); + } else { + navigate("/transfer?from=" + props.fed.federation_id); + } + } + const [confirmOpen, setConfirmOpen] = createSignal(false); const [confirmLoading, setConfirmLoading] = createSignal(false); @@ -385,6 +393,10 @@ function FederationListItem(props: { inviteCode={props.fed.invite_code} /> + + + {i18n.t("settings.manage_federations.transfer_funds")} + diff --git a/src/state/megaStore.tsx b/src/state/megaStore.tsx index 8221ab05..ec0245e0 100644 --- a/src/state/megaStore.tsx +++ b/src/state/megaStore.tsx @@ -28,7 +28,6 @@ import { BTC_OPTION, Currency, eify, - federationWarning, subscriptionValid, USD_OPTION } from "~/utils"; @@ -303,7 +302,23 @@ export const makeMegaStoreContext = () => { // Get federations const federations = await sw.list_federations(); - const expiration_warning = federationWarning(federations); + let expiration_warning: + | { + expiresTimestamp: number; + expiresMessage: string; + federationName: string; + } + | undefined = undefined; + + federations.forEach((f) => { + if (f.popup_countdown_message && f.popup_end_timestamp) { + expiration_warning = { + expiresTimestamp: f.popup_end_timestamp, + expiresMessage: f.popup_countdown_message, + federationName: f.federation_name + }; + } + }); setState({ wallet_loading: false, @@ -561,7 +576,23 @@ export const makeMegaStoreContext = () => { async refreshFederations() { const federations = await sw.list_federations(); - const expiration_warning = federationWarning(federations); + let expiration_warning: + | { + expiresTimestamp: number; + expiresMessage: string; + federationName: string; + } + | undefined = undefined; + + federations.forEach((f) => { + if (f.popup_countdown_message && f.popup_end_timestamp) { + expiration_warning = { + expiresTimestamp: f.popup_end_timestamp, + expiresMessage: f.popup_countdown_message, + federationName: f.federation_name + }; + } + }); setState({ federations, expiration_warning }); }, @@ -607,9 +638,6 @@ export const makeMegaStoreContext = () => { // Only show the expiration warning once per session clearExpirationWarning() { setState({ expiration_warning_seen: true }); - }, - resetExpirationWarning() { - setState({ expiration_warning_seen: false }); } }; diff --git a/src/utils/federationWarning.ts b/src/utils/federationWarning.ts deleted file mode 100644 index 8b13d53c..00000000 --- a/src/utils/federationWarning.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { MutinyFederationIdentity } from "~/routes/settings"; - -export function federationWarning(federations: MutinyFederationIdentity[]) { - const FEDERATIONS_WITH_WARNINGS = [ - // Freedom One - "c944b2fd1e7fe04ca87f9a57d7894cb69116cec6264cb52faa71228f4ec54cd6", - // Bitcoin Principles - "b21068c84f5b12ca4fdf93f3e443d3bd7c27e8642d0d52ea2e4dce6fdbbee9df" - ]; - - let expiration_warning: - | { - expiresTimestamp: number; - expiresMessage: string; - federationName: string; - } - | undefined = undefined; - - federations.forEach((f) => { - if (f.popup_countdown_message && f.popup_end_timestamp) { - expiration_warning = { - expiresTimestamp: f.popup_end_timestamp, - expiresMessage: f.popup_countdown_message, - federationName: f.federation_name - }; - } else if (FEDERATIONS_WITH_WARNINGS.includes(f.federation_id)) { - // If the federation has no expiration warning we'll do a generic one - expiration_warning = { - expiresTimestamp: 0, - expiresMessage: "", - federationName: "" - }; - } - }); - - return expiration_warning; -} diff --git a/src/utils/index.ts b/src/utils/index.ts index c79b328b..fbd8ef85 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -21,4 +21,3 @@ export * from "./bech32"; export * from "./keypad"; export * from "./debounce"; export * from "./blobToBase64"; -export * from "./federationWarning";