diff --git a/app/nextgraph/src/main-web.ts b/app/nextgraph/src/main-web.ts
index 25bad9bd..0b0e4631 100644
--- a/app/nextgraph/src/main-web.ts
+++ b/app/nextgraph/src/main-web.ts
@@ -11,7 +11,7 @@ import * as web_api from "@ng-org/lib-wasm";
import {init_api} from "@ng-org/ui-common/api";
init_api(web_api);
-const NEW_VERSION = "0.1.2-alpha.1";
+const NEW_VERSION = "0.1.2-alpha.2";
// cleaning old wallets :(
try {
diff --git a/app/ui-common/src/api.ts b/app/ui-common/src/api.ts
index 4c32cc62..43743310 100644
--- a/app/ui-common/src/api.ts
+++ b/app/ui-common/src/api.ts
@@ -23,14 +23,14 @@ let api = createAsyncProxy({},{
export default api;
-export const NG_EU_BSP = "https://nextgraph.eu";
+export const NG_EU_BSP = import.meta.env.NG_ENV_ALT ? "https://"+import.meta.env.NG_ENV_ALT : "https://nextgraph.eu";
export const NG_EU_BSP_REGISTER = import.meta.env.PROD
-? import.meta.env.NG_ENV_ALT ? "https://pnm.allelo.eco" : "https://account.nextgraph.eu/#/create"
+? import.meta.env.NG_ENV_ALT_ACCOUNT ? import.meta.env.NG_ENV_ALT_ACCOUNT : "https://account.nextgraph.eu/#/create"
: "http://account-dev.nextgraph.eu:5173/#/create";
export const NG_ONE_BSP = "https://nextgraph.one";
export const NG_ONE_BSP_REGISTER = import.meta.env.PROD
-? import.meta.env.NG_ENV_ALT ? "https://account.allelo.eco/#/create" : "https://account.nextgraph.one/#/create"
+? "https://account.nextgraph.one/#/create"
: "http://account-dev.nextgraph.one:5173/#/create";
export const APP_ACCOUNT_REGISTERED_SUFFIX = "/#/user/registered";
diff --git a/app/ui-common/src/locales/en.json b/app/ui-common/src/locales/en.json
index ac188205..719fae9d 100644
--- a/app/ui-common/src/locales/en.json
+++ b/app/ui-common/src/locales/en.json
@@ -342,7 +342,7 @@
},
"no_wallet": {
"welcome": "Welcome to NextGraph",
- "description": "We could not find a wallet saved on this device.",
+ "description": "We could not find a wallet on this device.",
"instructions_login": "If you already have a wallet, select \"Login\"",
"instructions_create": ", otherwise, select \"Create Wallet\" here below.",
"instructions_nocreate": ". Creation of a Wallet is not possible while
logging-in to a third-party app.",
diff --git a/app/ui-common/src/routes/WalletCreate.svelte b/app/ui-common/src/routes/WalletCreate.svelte
index daae9f77..5c6f6df5 100644
--- a/app/ui-common/src/routes/WalletCreate.svelte
+++ b/app/ui-common/src/routes/WalletCreate.svelte
@@ -23,6 +23,7 @@
import { t } from "svelte-i18n";
import CenteredLayout from "../lib/CenteredLayout.svelte";
import PasswordInput from "../lib/components/PasswordInput.svelte";
+ import { redirect_server, bootstrap_redirect, base64UrlEncode } from "./index";
// @ts-ignore
import Logo from "../assets/nextgraph.svg?component";
@@ -39,11 +40,6 @@
const param = new URLSearchParams($querystring);
- function base64UrlEncode(str) {
- const base64 = btoa(str); // Standard Base64 encoding
- return base64.replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
- }
-
let tauri_platform = import.meta.env.TAURI_PLATFORM;
let wait: any = false;
@@ -80,15 +76,6 @@
top.scrollIntoView();
}
- const redirect_server = import.meta.env.NG_REDIR_SERVER || "nextgraph.net";
- const bootstrap_redirect = import.meta.env.NG_DEV
- ? "http://localhost:1421/bootstrap.html#/?b="
- : import.meta.env.DEV
- ? "http://localhost:14403/#/?b="
- : import.meta.env.NG_DEV3
- ? "http://127.0.0.1:3033/bootstrap/#/?b="
- : `https://${redirect_server}/bootstrap/#/?b=`;
-
async function bootstrap() {
//console.log(await ng.client_info());
if (!tauri_platform || tauri_platform == "android") {
@@ -236,10 +223,6 @@
unsub_register = undefined;
});
- onDestroy(async () => {
- unsub_register();
- });
-
const select_bsp = async (bsp_url, bsp_name) => {
if (!tauri_platform || tauri_platform == "android") {
let redirect_url;
@@ -306,7 +289,7 @@
const selectEU = async (event) => {
await select_bsp(
NG_EU_BSP_REGISTER,
- import.meta.env.NG_ENV_ALT ? "pnm.allelo.eco" : "nextgraph.eu"
+ import.meta.env.NG_ENV_ALT ? import.meta.env.NG_ENV_ALT : "nextgraph.eu"
);
};
diff --git a/app/ui-common/src/routes/WalletLogin.svelte b/app/ui-common/src/routes/WalletLogin.svelte
index 500e9dc0..83d0c401 100644
--- a/app/ui-common/src/routes/WalletLogin.svelte
+++ b/app/ui-common/src/routes/WalletLogin.svelte
@@ -23,6 +23,11 @@
import CenteredLayout from "../lib/CenteredLayout.svelte";
import ng from "../api";
import { Fileupload, Button } from "flowbite-svelte";
+ import {
+ redirect_server,
+ bootstrap_redirect,
+ base64UrlEncode,
+ } from "./index";
// @ts-ignore
import Logo from "../assets/nextgraph.svg?component";
import {
@@ -162,21 +167,22 @@
$redirect_after_login = undefined;
$redirect_if_wallet_is = undefined;
let in_memory = !event.detail.trusted;
- //console.log("IMPORTING", in_memory, event.detail.wallet, wallet);
- // TODO : register bootstrap when importing
- // if (!in_memory && !tauri_platform) {
- // let bootstrap_iframe_msgs =
- // await ng.get_bootstrap_iframe_msgs_for_brokers(
- // event.detail.wallet.V0.brokers
- // );
- // let res = await register_bootstrap(bootstrap_iframe_msgs);
- // if (res !== true) {
- // throw new Error(
- // "We could not save your bootstrap information at nextgraph.net. This is needed for links and third-party webapps to work properly. so we are stopping here. Reason: " +
- // res
- // );
- // }
- // }
+ console.log("IMPORTING", in_memory, event.detail.wallet, wallet);
+ //register bootstrap when importing
+ if (!in_memory && !tauri_platform) {
+ let bootstrap_iframe_msgs =
+ await ng.get_bootstrap_iframe_msgs_for_brokers(
+ event.detail.wallet.V0.brokers
+ );
+ let encoded = base64UrlEncode(JSON.stringify(bootstrap_iframe_msgs));
+ let register_bootstrap_url =
+ bootstrap_redirect +
+ encoded +
+ "&close=1&m=add&ab=" +
+ encodeURIComponent(window.location.href);
+ console.log(register_bootstrap_url);
+ window.open(register_bootstrap_url, "_blank");
+ }
let client = await ng.wallet_import(
wallet,
event.detail.wallet,
@@ -328,14 +334,38 @@
on:click={start_login_from_import}
on:keypress={start_login_from_import}
>
- {$wallet_from_import.V0.content.security_txt}
-
-
+ {#if $wallet_from_import.V0.content.password}
+