mirror of
https://github.com/aljazceru/mutiny-web.git
synced 2026-01-04 23:04:27 +01:00
more fixes
This commit is contained in:
committed by
Tony Giorgio
parent
85448fb7a5
commit
7a962c5f92
@@ -41,6 +41,7 @@ import {
|
||||
import { useI18n } from "~/i18n/context";
|
||||
import { useMegaStore } from "~/state/megaStore";
|
||||
import { eify } from "~/utils";
|
||||
import { baseUrlAccountingForNative } from "~/utils/baseUrl";
|
||||
import { createDeepSignal } from "~/utils/deepSignal";
|
||||
|
||||
type CreateGiftForm = {
|
||||
@@ -57,10 +58,7 @@ export function SingleGift(props: {
|
||||
|
||||
const network = state.mutiny_wallet?.get_network();
|
||||
|
||||
const baseUrl =
|
||||
network === "bitcoin"
|
||||
? "https://app.mutinywallet.com"
|
||||
: "https://signet-app.mutinywallet.com";
|
||||
const baseUrl = baseUrlAccountingForNative(network);
|
||||
|
||||
const sharableUrl = () => baseUrl.concat(props.profile.url_suffix || "");
|
||||
const amount = () => props.profile.budget_amount?.toString() || "0";
|
||||
@@ -204,7 +202,7 @@ export default function GiftPage() {
|
||||
return Number(getValue(giftForm, "amount")) < 50000;
|
||||
};
|
||||
|
||||
const selfHosted = state.mutiny_wallet?.get_network() === "signet";
|
||||
const selfHosted = state.settings?.selfhosted === "true";
|
||||
const canGift = state.mutiny_plus || selfHosted;
|
||||
|
||||
return (
|
||||
|
||||
12
src/utils/baseUrl.ts
Normal file
12
src/utils/baseUrl.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { Capacitor } from "@capacitor/core";
|
||||
|
||||
// On mobile the origin URL is localhost, so we hardcode the base URL
|
||||
export function baseUrlAccountingForNative(network?: string) {
|
||||
if (Capacitor.isNativePlatform()) {
|
||||
return network === "bitcoin"
|
||||
? "https://app.mutinywallet.com"
|
||||
: "https://signet-app.mutinywallet.com";
|
||||
} else {
|
||||
return window.location.origin;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user