Skip to content

Commit

Permalink
Merge pull request #17 from dmccartney/daniel-manifest-fix
Browse files Browse the repository at this point in the history
fix: prevent manifest not found errors in safe
  • Loading branch information
dmccartney authored Jun 9, 2023
2 parents 858411e + 981972d commit 046a0ed
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions web/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<link rel="icon shortcut" href="/favicon.ico"/>
<link rel="manifest" href="/manifest.json" />
<title>Rocket Sweep - Distributing operator rewards for Rocket Pool</title>
</head>
<body>
Expand Down
6 changes: 2 additions & 4 deletions web/src/components/SafeSweepCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
import _ from "lodash";
import { useState } from "react";
import { ethers } from "ethers";
import { useAccount, useEnsName } from "wagmi";
import { useAccount } from "wagmi";
import SafeAppsSDK from "@safe-global/safe-apps-sdk";
import {
BNSortComparator,
Expand Down Expand Up @@ -222,8 +222,6 @@ function useSortedMinipoolDetails(nodeAddress) {
}

function SafeAlert({ sx, label, nodeAddress, safeAddress }) {
let { data: name } = useEnsName({ address: nodeAddress });
let nodeAddressOrName = name || nodeAddress;
let { connector } = useAccount();
if (connector?.id === "safe") {
// No alert when it is already open as a Safe app.
Expand All @@ -232,7 +230,7 @@ function SafeAlert({ sx, label, nodeAddress, safeAddress }) {
return (
<Card sx={sx} elevation={8} square>
<CardActionArea
href={safeAppUrl({ safeAddress, path: `/node/${nodeAddressOrName}` })}
href={safeAppUrl({ safeAddress })}
target="_blank"
>
<CardHeader
Expand Down
6 changes: 4 additions & 2 deletions web/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,11 @@ export function rocketscanUrl({ network = "mainnet", node, minipool }) {
export function safeAppUrl({
safeAddress,
appUrl = process.env.REACT_APP_ROCKET_SWEEP_URL,
path = "",
}) {
return `https://app.safe.global/apps/open?safe=eth:${safeAddress}&appUrl=${appUrl}${path}`;
const url = new URL(`https://app.safe.global/apps/open`)
url.searchParams.append('safe', `eth:${safeAddress}`)
url.searchParams.append('appUrl', appUrl)
return url.toString()
}

export function bnSum(arr) {
Expand Down

0 comments on commit 046a0ed

Please sign in to comment.