Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prod 1.7.13 #1260

Merged
merged 2 commits into from
Jul 9, 2024
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 android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions ios/App/App.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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)";
Expand All @@ -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 = "";
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mutiny-wallet",
"version": "1.7.12",
"version": "1.7.13",
"license": "MIT",
"packageManager": "[email protected]",
"scripts": {
Expand Down Expand Up @@ -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",
Expand Down
9 changes: 5 additions & 4 deletions pnpm-lock.yaml

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

6 changes: 1 addition & 5 deletions public/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/components/Activity.tsx
Original file line number Diff line number Diff line change
@@ -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";

Check warning on line 3 in src/components/Activity.tsx

View workflow job for this annotation

GitHub Actions / code_quality

'Users' is defined but never used. Allowed unused vars must match /^_/u

Check warning on line 3 in src/components/Activity.tsx

View workflow job for this annotation

GitHub Actions / code_quality

'Users' is defined but never used. Allowed unused vars must match /^_/u

Check warning on line 3 in src/components/Activity.tsx

View workflow job for this annotation

GitHub Actions / code_quality

'Users' is defined but never used. Allowed unused vars must match /^_/u
import {
createEffect,
createMemo,
Expand Down
53 changes: 6 additions & 47 deletions src/components/FederationPopup.tsx
Original file line number Diff line number Diff line change
@@ -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";

Expand All @@ -21,11 +16,9 @@ export function FederationPopup() {
const i18n = useI18n();
const navigate = useNavigate();

const name = state.expiration_warning?.federationName;

return (
<SimpleDialog
title={`${i18n.t("activity.federation_message")} ${name ? `: ${name}` : ""}`}
title={`${i18n.t("activity.federation_message")}: ${state.expiration_warning?.federationName}`}
open={showFederationExpirationWarning()}
setOpen={(open: boolean) => {
if (!open) {
Expand All @@ -34,41 +27,7 @@ export function FederationPopup() {
}
}}
>
<NiceP>
{state.expiration_warning?.expiresMessage ||
i18n.t("home.federations_warn_generic")}
</NiceP>
<Show when={!name}>
<NiceP>
<ExternalLink href="https://x.com/MutinyWallet/status/1805346636660429021">
{i18n.t("settings.manage_federations.learn_more")}
</ExternalLink>
</NiceP>
</Show>
<ButtonCard
onClick={() => {
actions.clearExpirationWarning();
setShowFederationExpirationWarning(false);
navigate("/swaplightning");
}}
>
<div class="flex items-center gap-2">
<ArrowLeftRight class="inline-block text-m-red" />
<NiceP>{i18n.t("home.transfer_lightning")}</NiceP>
</div>
</ButtonCard>
<ButtonCard
onClick={() => {
actions.clearExpirationWarning();
setShowFederationExpirationWarning(false);
navigate("/send");
}}
>
<div class="flex items-center gap-2">
<ArrowUpRight class="inline-block text-m-red" />
<NiceP>{i18n.t("home.sent_to_another_wallet")}</NiceP>
</div>
</ButtonCard>
<NiceP>{state.expiration_warning?.expiresMessage}</NiceP>
<ButtonCard
onClick={() => {
actions.clearExpirationWarning();
Expand All @@ -78,7 +37,7 @@ export function FederationPopup() {
>
<div class="flex items-center gap-2">
<Users class="inline-block text-m-red" />
<NiceP>{i18n.t("profile.leave_federation")}</NiceP>
<NiceP>{i18n.t("profile.manage_federation")}</NiceP>
</div>
</ButtonCard>
</SimpleDialog>
Expand Down
20 changes: 16 additions & 4 deletions src/routes/settings/ManageFederations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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);
Expand All @@ -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);

Expand Down Expand Up @@ -385,6 +393,10 @@ function FederationListItem(props: {
inviteCode={props.fed.invite_code}
/>
</KeyValue>
<SubtleButton onClick={transferFunds}>
<ArrowLeftRight class="h-4 w-4" />
{i18n.t("settings.manage_federations.transfer_funds")}
</SubtleButton>
<Suspense>
<RecommendButton fed={props.fed} />
</Suspense>
Expand Down
40 changes: 34 additions & 6 deletions src/state/megaStore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import {
BTC_OPTION,
Currency,
eify,
federationWarning,
subscriptionValid,
USD_OPTION
} from "~/utils";
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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 });
},
Expand Down Expand Up @@ -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 });
}
};

Expand Down
37 changes: 0 additions & 37 deletions src/utils/federationWarning.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,3 @@ export * from "./bech32";
export * from "./keypad";
export * from "./debounce";
export * from "./blobToBase64";
export * from "./federationWarning";
Loading