Skip to content
This repository has been archived by the owner on Aug 1, 2022. It is now read-only.

Commit

Permalink
fix: use new URL layout for Gnosis Safe deep links
Browse files Browse the repository at this point in the history
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
  • Loading branch information
rudolfs committed Nov 30, 2021
1 parent 726c6ce commit 15c1479
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion ui/App/OrgScreen.svelte
Expand Up @@ -78,7 +78,7 @@
title: "View on Gnosis Safe",
icon: GnosisIcon,
event: () => {
org.openOnGnosisSafe(gnosisSafeAddress, "transactions");
org.openOnGnosisSafe(gnosisSafeAddress, "transactions/queue");
},
},
{
Expand Down
2 changes: 1 addition & 1 deletion ui/App/OrgScreen/ConfigureEns/LinkOrgToName.svelte
Expand Up @@ -48,7 +48,7 @@
label: "View on Gnosis Safe",
handler: () => {
safeAddress &&
org.openOnGnosisSafe(safeAddress, "transactions");
org.openOnGnosisSafe(safeAddress, "transactions/queue");
},
},
{
Expand Down
2 changes: 1 addition & 1 deletion ui/App/OrgScreen/MembersMenu.svelte
Expand Up @@ -50,7 +50,7 @@

<Button
on:click={() => {
org.openOnGnosisSafe(gnosisSafeAddress, "settings");
org.openOnGnosisSafe(gnosisSafeAddress, "settings/owners");
toggleModal();
}}
style="margin-top: 1rem; width: 100%; display: block; text-align: center;">
Expand Down
4 changes: 2 additions & 2 deletions ui/App/OrgScreen/Projects.svelte
Expand Up @@ -82,13 +82,13 @@
Waiting for a member to execute this anchor transaction.
<a
class="typo-link"
href={org.gnosisSafeWebAppUrl(ownerAddress, "transactions")}
href={org.gnosisSafeWebAppUrl(ownerAddress, "transactions/queue")}
>Execute transaction</a>
{:else}
Not enough members have confirmed this anchor transaction.
<a
class="typo-link"
href={org.gnosisSafeWebAppUrl(ownerAddress, "transactions")}
href={org.gnosisSafeWebAppUrl(ownerAddress, "transactions/queue")}
>Confirm transaction</a>
{/if}
</p>
Expand Down
6 changes: 3 additions & 3 deletions ui/src/org.ts
Expand Up @@ -119,14 +119,14 @@ export function initialize(): void {

export function openOnGnosisSafe(
gnosisSafeAddress: string,
view: "transactions" | "settings"
view: "transactions/queue" | "settings/owners"
): void {
ipc.openUrl(gnosisSafeWebAppUrl(gnosisSafeAddress, view));
}

export function gnosisSafeWebAppUrl(
gnosisSafeAddress: string,
view: "transactions" | "settings"
view: "transactions/queue" | "settings/owners"
): string {
return Safe.appUrl(
svelteStore.get(wallet.store).environment,
Expand Down Expand Up @@ -187,7 +187,7 @@ export async function anchorProjectWithGnosis(
{
label: "View on Gnosis Safe",
handler: () => {
openOnGnosisSafe(safeAddress, "transactions");
openOnGnosisSafe(safeAddress, "transactions/queue");
},
},
{
Expand Down
10 changes: 5 additions & 5 deletions ui/src/org/safe.ts
Expand Up @@ -114,22 +114,22 @@ export async function signAndProposeTransaction(
export function appUrl(
ethEnv: Ethereum.Environment,
gnosisSafeAddress: string,
view: "transactions" | "settings"
view: "transactions/queue" | "settings/owners"
): string {
let domain: string;
let network: string;
switch (ethEnv) {
case Ethereum.Environment.Local:
throw new error.Error({
message: "appUrl() is not implemented for ethereum.Environment.Local",
});
case Ethereum.Environment.Rinkeby:
domain = `rinkeby.gnosis-safe.io`;
network = "rin";
break;
case Ethereum.Environment.Mainnet:
domain = `gnosis-safe.io`;
network = "eth";
break;
}
return `https://${domain}/app/#/safes/${gnosisSafeAddress}/${view}`;
return `https://gnosis-safe.io/app/${network}:${gnosisSafeAddress}/${view}`;
}

function createSafeServiceClient(
Expand Down

0 comments on commit 15c1479

Please sign in to comment.