diff --git a/package.json b/package.json
index 17801e37..d7f8d777 100644
--- a/package.json
+++ b/package.json
@@ -8,7 +8,7 @@
"@babel/plugin-transform-react-jsx": "7.21.0",
"@capacitor/android": "3.6.0",
"@capacitor/core": "3.6.0",
- "@plebbit/plebbit-react-hooks": "https://github.com/plebbit/plebbit-react-hooks.git#91ea5a494fde74836b085e912f671cc5489ecf09",
+ "@plebbit/plebbit-react-hooks": "https://github.com/plebbit/plebbit-react-hooks.git#e602eda8080f2b3449388c2d5868d6e6da60c8f6",
"@testing-library/dom": "9.0.1",
"@testing-library/jest-dom": "5.14.1",
"@testing-library/react": "14.0.0",
diff --git a/public/assets/offline.png b/public/assets/offline.png
index a40aa2bb..2ca2cc93 100644
Binary files a/public/assets/offline.png and b/public/assets/offline.png differ
diff --git a/src/components/BoardAvatar.jsx b/src/components/BoardAvatar.jsx
index 7cbe0f47..8d5a040b 100644
--- a/src/components/BoardAvatar.jsx
+++ b/src/components/BoardAvatar.jsx
@@ -25,7 +25,7 @@ const BoardAvatar = ({ address }) => {
{!isOnline && (
)}
diff --git a/src/components/OfflineIndicator.jsx b/src/components/OfflineIndicator.jsx
index bae408c8..6596c4bf 100644
--- a/src/components/OfflineIndicator.jsx
+++ b/src/components/OfflineIndicator.jsx
@@ -16,7 +16,7 @@ const OfflineIndicator = ({ address, className, tooltipPlace }) => {
alt="offline"
src="assets/offline.png"
data-tooltip-id="tooltip"
- data-tooltip-content="OFFLINE"
+ data-tooltip-content="Offline"
data-tooltip-place={tooltipPlace}
/>
>
diff --git a/src/components/ReplyModal.jsx b/src/components/ReplyModal.jsx
index f11df31f..fa421a25 100644
--- a/src/components/ReplyModal.jsx
+++ b/src/components/ReplyModal.jsx
@@ -1,5 +1,4 @@
import React, { useCallback, useEffect, useRef, useState } from 'react';
-import { useLocation } from 'react-router-dom';
import { usePublishComment } from '@plebbit/plebbit-react-hooks';
import { StyledModal } from './styled/ReplyModal.styled';
import useGeneralStore from '../hooks/stores/useGeneralStore';
@@ -33,8 +32,7 @@ const ReplyModal = ({ isOpen, closeModal }) => {
const [selectedText, setSelectedText] = useState('');
useError(errorMessage, [errorMessage]);
-
- const location = useLocation();
+
const onModalOpen = () => {
@@ -109,7 +107,7 @@ const ReplyModal = ({ isOpen, closeModal }) => {
if (index !== undefined) {
setPendingCommentIndex(index);
}
- }, [index, location, setPendingCommentIndex]);
+ }, [index, setPendingCommentIndex]);
const resetFields = useCallback(() => {
diff --git a/src/components/SettingsModal.jsx b/src/components/SettingsModal.jsx
index d85fa026..766d18c5 100644
--- a/src/components/SettingsModal.jsx
+++ b/src/components/SettingsModal.jsx
@@ -1,7 +1,7 @@
import React, { useState, useEffect, useRef } from "react";
import { Link, useLocation, useNavigate } from "react-router-dom";
import Modal from "react-modal";
-import { deleteCaches, setAccount, useAccount } from "@plebbit/plebbit-react-hooks";
+import { deleteCaches, exportAccount, importAccount, setAccount, setActiveAccount, useAccount, useAccounts } from "@plebbit/plebbit-react-hooks";
import { StyledModal } from "./styled/SettingsModal.styled";
import useGeneralStore from "../hooks/stores/useGeneralStore";
import useError from "../hooks/useError";
@@ -10,28 +10,27 @@ import packageJson from '../../package.json'
const {version} = packageJson
-const customOverlayStyles = {
- overlay: {
- backgroundColor: 'rgba(0,0,0,.25)'
- }
-};
-
const SettingsModal = ({ isOpen, closeModal }) => {
const selectedStyle = useGeneralStore(state => state.selectedStyle);
const navigate = useNavigate();
const location = useLocation();
const [expanded, setExpanded] = useState([]);
+ const [accountJson, setAccountJson] = useState(null);
+ const [setImportSuccess] = useState(false);
+
const [errorMessage, setErrorMessage] = useState(null);
const [successMessage, setSuccessMessage] = useState(null);
useError(errorMessage, [errorMessage]);
useSuccess(successMessage, [successMessage]);
const account = useAccount();
+ const { accounts } = useAccounts();
const gatewayRef = useRef();
const ipfsRef = useRef();
const pubsubRef = useRef();
const dataPathRef = useRef();
+ const importRef = useRef();
const isValidURL = (url) => {
try {
@@ -108,6 +107,8 @@ const SettingsModal = ({ isOpen, closeModal }) => {
const handleCloseModal = () => {
+ setAccountJson(null);
+
if (location.pathname.endsWith("/settings")) {
const newPath = location.pathname.slice(0, -9);
closeModal();
@@ -146,7 +147,31 @@ const SettingsModal = ({ isOpen, closeModal }) => {
localStorage.removeItem("cacheCleared");
}
}, []);
-
+
+
+ const handleExport = async () => {
+ const activeAccountJson = await exportAccount();
+ setAccountJson(activeAccountJson);
+ };
+
+
+ const handleImport = async () => {
+ const accountJson = importRef.current.value;
+
+ try {
+ await importAccount(accountJson);
+ setImportSuccess(true);
+ localStorage.setItem("toastMessage", "Account Imported");
+ window.location.reload();
+
+ } catch (error) {
+ setErrorMessage(error.message);
+ }
+ };
+
+ const handleAccountChange = (e) => {
+ setActiveAccount(e.target.value);
+ };
return (
@@ -154,7 +179,7 @@ const SettingsModal = ({ isOpen, closeModal }) => {
isOpen={isOpen}
onRequestClose={handleCloseModal}
contentLabel="Settings"
- style={customOverlayStyles}
+ style={{ overlay: { backgroundColor: "rgba(0,0,0,.25)" }}}
selectedStyle={selectedStyle}
expanded={expanded}
>
@@ -189,7 +214,7 @@ const SettingsModal = ({ isOpen, closeModal }) => {
-
+ */}
{
/>
toggleExpanded(1)}
- >Profile
+ >Account
+
+
-
+
+ Export or Import Your Data
+
+
+ Export
+ Import
+
+
+ To export, click "Export", then save your account data displayed below in a safe place. To import, paste your account data into the box below, then click "Import".
+
+
+
+
+
+ Current Account: {account?.name}
+
+
+ Select a different account to use in the dropdown below.
- */}
+
+
{
onClick={() => toggleExpanded(2)}
>Plebbit Options
- Save
- Reset
-
+ Save
+ Reset
+
- IPFS Gateway URLs
- Optional URLs of IPFS gateways.
+ IPFS Gateway URLs
+
+
+ Optional URLs of IPFS gateways.
+
@@ -145,16 +145,16 @@ const Home = () => {
- Plebbit
+ Token
Donate
- Whitepaper
+ Whitepaper
- Token
+ GitHub
Matrix
@@ -163,7 +163,7 @@ const Home = () => {
Telegram
- Twitter
+ Twitter
Discord
diff --git a/src/components/views/Pending.jsx b/src/components/views/Pending.jsx
index b9911e05..944f6c86 100644
--- a/src/components/views/Pending.jsx
+++ b/src/components/views/Pending.jsx
@@ -1,4 +1,4 @@
-import React, { useEffect, useState } from 'react';
+import React, { useEffect, useMemo, useState } from 'react';
import { Helmet } from 'react-helmet-async';
import { Link, useNavigate, useParams } from 'react-router-dom';
import { Tooltip } from 'react-tooltip';
@@ -10,12 +10,12 @@ import ImageBanner from '../ImageBanner';
import Post from '../Post';
import PostLoader from '../PostLoader';
import SettingsModal from '../SettingsModal';
-import formatState from '../../utils/formatState';
import getCommentMediaInfo from '../../utils/getCommentMediaInfo';
import getDate from '../../utils/getDate';
import handleQuoteClick from '../../utils/handleQuoteClick';
import handleStyleChange from '../../utils/handleStyleChange';
import useError from '../../hooks/useError';
+import useStateString from '../../hooks/useStateString';
import packageJson from '../../../package.json'
const {version} = packageJson
@@ -26,7 +26,6 @@ const Pending = () => {
isSettingsOpen, setIsSettingsOpen,
selectedAddress, setSelectedAddress,
selectedStyle,
- selectedThread,
selectedTitle, setSelectedTitle,
showPostFormLink
} = useGeneralStore(state => state);
@@ -35,20 +34,34 @@ const Pending = () => {
const account = useAccount();
const comment = useAccountComment({commentIndex: index});
- const { publishingState, error } = useAccountComment({commentIndex: index});
-
+
+ useEffect(() => {
+ setSelectedAddress(comment?.subplebbitAddress);
+ }, [comment, setSelectedAddress]);
+
+ const stateString = useStateString(comment?.clients)
+
+ const errorString = useMemo(() => {
+ if (comment?.state === 'failed') {
+ let errorString = 'Failed fetching pending thread. Pending index: ' + index;
+ if (comment.error) {
+ errorString += `: ${comment.error.toString().slice(0, 300)}`
+ }
+ return errorString
+ }
+ }, [comment?.state, comment?.error, index])
+
+ useEffect(() => {
+ if (errorString) {
+ setErrorMessage(errorString);
+ }
+ }, [errorString]);
+
const [visible] = useState(true);
const [errorMessage, setErrorMessage] = useState(null);
useError(errorMessage, [errorMessage]);
- useEffect(() => {
- if (error) {
- const errorMessage = formatState(error);
- setErrorMessage(errorMessage);
- }
- }, [error]);
-
const navigate = useNavigate();
const [commentMediaInfo, setCommentMediaInfo] = useState(null);
const fallbackImgUrl = "assets/filedeleted-res.gif";
@@ -83,22 +96,26 @@ const Pending = () => {
closeModal={() => setIsSettingsOpen(false)} />
<>
- {defaultSubplebbits.map(subplebbit => (
+
+ [
+ Subscriptions
+ ] [
+ {defaultSubplebbits.map((subplebbit, index) => (
- [
- {
- setSelectedTitle(subplebbit.title);
- setSelectedAddress(subplebbit.address);
+ {index === 0 ? null : "\u00a0"}
+ {
+ setSelectedTitle(subplebbit.title);
+ setSelectedAddress(subplebbit.address);
}}
>{subplebbit.title ? subplebbit.title : subplebbit.address}
- ]
+ {index !== defaultSubplebbits.length - 1 ? " /" : null}
))}
+ ]
+
[
- setIsSettingsOpen(true)}>Settings
+ setIsSettingsOpen(true)}>Settings
]
[
handleStyleChange({target: {value: "Yotsuba"}}
@@ -117,7 +134,7 @@ const Pending = () => {
- setIsSettingsOpen(true)}>Settings
+ setIsSettingsOpen(true)}>Settings
handleStyleChange({target: {value: "Yotsuba"}}
)}>Home
@@ -178,7 +195,7 @@ const Pending = () => {
Catalog
]
- {formatState(publishingState)}
+ {stateString}
diff --git a/src/components/views/Subscriptions.jsx b/src/components/views/Subscriptions.jsx
index 5587b56c..787afe75 100644
--- a/src/components/views/Subscriptions.jsx
+++ b/src/components/views/Subscriptions.jsx
@@ -3,7 +3,7 @@ import { Helmet } from 'react-helmet-async';
import { Link, useNavigate } from 'react-router-dom';
import { Tooltip } from 'react-tooltip';
import { Virtuoso } from 'react-virtuoso';
-import { useAccount, useAccountComments, useFeed } from '@plebbit/plebbit-react-hooks';
+import { useAccount, useAccountComments, useFeed, useSubplebbits } from '@plebbit/plebbit-react-hooks';
import { flattenCommentsPages } from '@plebbit/plebbit-react-hooks/dist/lib/utils'
import { debounce } from 'lodash';
import useGeneralStore from '../../hooks/stores/useGeneralStore';
@@ -23,6 +23,7 @@ import handleImageClick from '../../utils/handleImageClick';
import handleQuoteClick from '../../utils/handleQuoteClick';
import handleStyleChange from '../../utils/handleStyleChange';
import useError from '../../hooks/useError';
+import useFeedStateString from '../../hooks/useFeedStateString';
import packageJson from '../../../package.json'
const {version} = packageJson
@@ -45,15 +46,39 @@ const Subscriptions = () => {
const navigate = useNavigate();
const [prevScrollPos, setPrevScrollPos] = useState(0);
const [visible, setVisible] = useState(true);
+
+ const [errorMessage, setErrorMessage] = useState(null);
+ useError(errorMessage, [errorMessage]);
+
const { feed, hasMore, loadMore } = useFeed({subplebbitAddresses: account?.subscriptions, sortType: 'new'});
const [selectedFeed, setSelectedFeed] = useState(feed.sort((a, b) => b.timestamp - a.timestamp));
+ const {subplebbits} = useSubplebbits({subplebbitAddresses: account?.subscriptions, sortType: 'new'});
+
+ const stateString = useFeedStateString(subplebbits);
+
+ const errorString = useMemo(() => {
+ for (const subplebbit of subplebbits) {
+ if (subplebbit?.updatingState !== 'failed') {
+ return
+ }
+ }
+ for (const subplebbit of subplebbits) {
+ if (subplebbit?.error) {
+ return `Failed fetching subplebbit: ${subplebbit?.error.toString().slice(0, 300)}`
+ }
+ }
+ }, [subplebbits])
+
+ useEffect(() => {
+ if (errorString) {
+ setErrorMessage(errorString)
+ }
+ }, [errorString])
+
useEffect(() => {
setSelectedFeed(feed.sort((a, b) => b.timestamp - a.timestamp));
}, [feed]);
-
- const [errorMessage] = useState(null);
- useError(errorMessage, [errorMessage]);
const flattenedRepliesByThread = useMemo(() => {
@@ -172,10 +197,6 @@ const Subscriptions = () => {
{index === 0 ? null : "\u00a0"}
handleClickTitle(subplebbit.title, subplebbit.address)}
>{subplebbit.title ? subplebbit.title : subplebbit.address}
-
{index !== defaultSubplebbits.length - 1 ? " /" : null}
))}
@@ -262,6 +283,13 @@ const Subscriptions = () => {
Catalog
]
+ {feed.length > 0 ? (
+ null
+ ) : (
+
+ {stateString}
+
+ )}
Catalog
@@ -523,12 +551,27 @@ const Subscriptions = () => {
)}
p/
- {thread.subplebbitAddress.includes(".eth") ? thread.subplebbitAddress : (
- {thread.subplebbitAddress.slice(0, 10) + "(...)"}
+ {thread.subplebbitAddress.includes(".eth") ?
+ (
+ <>
+ {thread.subplebbitAddress}
+
+ >
+ ) : (
+ <>
+ {thread.subplebbitAddress.slice(0, 10) + "(...)"}
+
+ >
)}
diff --git a/src/components/views/SubscriptionsCatalog.jsx b/src/components/views/SubscriptionsCatalog.jsx
index d5b99b46..bbfd7694 100644
--- a/src/components/views/SubscriptionsCatalog.jsx
+++ b/src/components/views/SubscriptionsCatalog.jsx
@@ -2,6 +2,7 @@ import React, { Fragment, useEffect, useState } from 'react';
import { Helmet } from 'react-helmet-async';
import InfiniteScroll from 'react-infinite-scroller';
import { Link, useNavigate } from 'react-router-dom';
+import { Tooltip } from 'react-tooltip';
import { useAccount, useFeed } from '@plebbit/plebbit-react-hooks';
import { debounce } from 'lodash';
import useGeneralStore from '../../hooks/stores/useGeneralStore';
@@ -106,10 +107,6 @@ const SubscriptionsCatalog = () => {
setSelectedAddress(subplebbit.address);
}}
>{subplebbit.title ? subplebbit.title : subplebbit.address}
-
{index !== defaultSubplebbits.length - 1 ? " /" : null}
))}
@@ -203,6 +200,7 @@ const SubscriptionsCatalog = () => {
+
{selectedFeed.length < 1 ? (
@@ -254,9 +252,21 @@ const SubscriptionsCatalog = () => {
) : null}
) : null}
- {/*
-
-
*/}
+
+ {thread.link ? (
+ // */
+
+ ) : (
+ // */
+
+ ) }
+
R:
{thread.replyCount}
diff --git a/src/components/views/Thread.jsx b/src/components/views/Thread.jsx
index ac49693b..47029d09 100644
--- a/src/components/views/Thread.jsx
+++ b/src/components/views/Thread.jsx
@@ -15,7 +15,6 @@ import PostLoader from '../PostLoader';
import ReplyModal from '../ReplyModal';
import SettingsModal from '../SettingsModal';
import findShortParentCid from '../../utils/findShortParentCid';
-import formatState from '../../utils/formatState';
import getCommentMediaInfo from '../../utils/getCommentMediaInfo';
import getDate from '../../utils/getDate';
import handleAddressClick from '../../utils/handleAddressClick';
@@ -24,6 +23,7 @@ import handleQuoteClick from '../../utils/handleQuoteClick';
import handleStyleChange from '../../utils/handleStyleChange';
import useClickForm from '../../hooks/useClickForm';
import useError from '../../hooks/useError';
+import useStateString from '../../hooks/useStateString';
import packageJson from '../../../package.json'
const {version} = packageJson
@@ -52,6 +52,11 @@ const Thread = () => {
const commentRef = useRef();
const linkRef = useRef();
+ const [triggerPublishComment, setTriggerPublishComment] = useState(false);
+
+ const [errorMessage, setErrorMessage] = useState(null);
+ useError(errorMessage, [errorMessage]);
+
const [isReplyOpen, setIsReplyOpen] = useState(false);
const navigate = useNavigate();
const [prevScrollPos, setPrevScrollPos] = useState(0);
@@ -61,13 +66,28 @@ const Thread = () => {
const { subplebbitAddress, threadCid } = useParams();
const handleClickForm = useClickForm();
+ const stateString = useStateString(comment?.clients);
+
const commentMediaInfo = getCommentMediaInfo(comment);
const fallbackImgUrl = "assets/filedeleted-res.gif";
- const [errorMessage, setErrorMessage] = useState(null);
- useError(errorMessage, [errorMessage]);
- const [triggerPublishComment, setTriggerPublishComment] = useState(false);
+ const errorString = useMemo(() => {
+ if (comment?.state === 'failed') {
+ let errorString = 'Failed fetching thread.'
+ if (comment.error) {
+ errorString += `: ${comment.error.toString().slice(0, 300)}`
+ }
+ return errorString
+ }
+ }, [comment?.state, comment?.error])
+
+
+ useEffect(() => {
+ if (errorString) {
+ setErrorMessage(errorString);
+ }
+ }, [errorString]);
const flattenedReplies = useMemo(() =>
@@ -210,6 +230,7 @@ const Thread = () => {
await publishComment();
resetFields();
})();
+ setTriggerPublishComment(false);
}
}, [publishCommentOptions, triggerPublishComment, publishComment, resetFields]);
@@ -298,10 +319,6 @@ const Thread = () => {
setSelectedAddress(subplebbit.address);
}}
>{subplebbit.title ? subplebbit.title : subplebbit.address}
-
{index !== defaultSubplebbits.length - 1 ? " /" : null}
))}
@@ -358,7 +375,12 @@ const Thread = () => {
<>
{selectedTitle}
- p/{selectedAddress}
+ p/{selectedAddress}
+
+
>
>
@@ -463,10 +485,10 @@ const Thread = () => {
No replies yet
)
) : (
- {formatState(comment.state)}
+ {stateString}
)
) : (
- {formatState(comment.state)}
+ {stateString}
)}
@@ -1036,10 +1058,10 @@ const Thread = () => {
No replies yet
)
) : (
- {formatState(comment.state)}
+ {stateString}
)
) : (
- {formatState(comment.state)}
+ {stateString}
)}
diff --git a/src/hooks/useFeedStateString.js b/src/hooks/useFeedStateString.js
new file mode 100644
index 00000000..62860894
--- /dev/null
+++ b/src/hooks/useFeedStateString.js
@@ -0,0 +1,64 @@
+import { useMemo } from "react"
+
+const useFeedStateString = (subplebbits) => {
+ return useMemo(() => {
+ const getClientUrls = (regex) => {
+ const clientUrls = new Set()
+ for (const clientType in subplebbits.clients) {
+ for (const clientUrl in subplebbits.clients[clientType]) {
+ const client = subplebbits.clients[clientType][clientUrl]
+ if (client.state.match(regex)) {
+ clientUrls.add(clientUrl)
+ }
+ }
+ }
+ return [...clientUrls]
+ }
+
+ if (!subplebbits) {
+ return undefined;
+ }
+
+ const states = {}
+ for (const subplebbit of subplebbits) {
+ states[subplebbit?.updatingState] = (states[subplebbit?.updatingState] || 0) + 1
+ }
+
+ // e.g. Resolving 2 addresses from infura.io, fetching 2 IPNS, 1 IPFS from cloudflare-ipfs.com, ipfs.io
+ let stateString = ''
+ if (states['resolving-address']) {
+ stateString += `resolving ${states['resolving-address']} addresses`
+ const clientUrls = getClientUrls(/address/)
+ if (clientUrls.length) {
+ stateString += ` from ${clientUrls.join(', ')}`
+ }
+ }
+ if (states['fetching-ipns'] || states['fetching-ipfs']) {
+ if (stateString) {
+ stateString += ', '
+ }
+ stateString += `fetching `
+ if (states['fetching-ipns']) {
+ stateString += `${states['fetching-ipns']} IPNS`
+ }
+ if (states['fetching-ipfs']) {
+ if (states['fetching-ipns']) {
+ stateString += ', '
+ }
+ stateString += `${states['fetching-ipfs']} IPNS`
+ }
+ const clientUrls = getClientUrls(/ipfs|ipns/)
+ if (clientUrls.length) {
+ stateString += ` from ${clientUrls.join(', ')}`
+ }
+ }
+
+ // capitalize first letter
+ stateString = stateString.charAt(0).toUpperCase() + stateString.slice(1)
+
+ // if string is empty, return undefined instead
+ return stateString || undefined
+ }, [subplebbits])
+}
+
+export default useFeedStateString
\ No newline at end of file
diff --git a/src/hooks/useStateString.js b/src/hooks/useStateString.js
new file mode 100644
index 00000000..34ff0a0a
--- /dev/null
+++ b/src/hooks/useStateString.js
@@ -0,0 +1,54 @@
+import { useMemo } from 'react'
+import isValidUrl from '../utils/isValidUrl'
+
+const useStateString = (clients) => {
+ return useMemo(() => {
+ if (!clients) {
+ return
+ }
+
+ const states = {}
+ for (const clientType in clients) {
+ for (const clientUrl in clients[clientType]) {
+ const state = clients[clientType][clientUrl].state
+ if (state === 'stopped') {
+ continue
+ }
+ if (!states[state]) {
+ states[state] = []
+ }
+ states[state].push(clientUrl)
+ }
+ }
+
+ let stateString = ''
+ for (const state in states) {
+ const clientUrls = states[state]
+ const clientHosts = clientUrls.filter(isValidUrl).map(clientUrl => new URL(clientUrl).hostname)
+
+ // if there are no valid hosts, skip this state
+ if (clientHosts.length === 0) {
+ continue
+ }
+
+ // separate 2 different states using ', '
+ if (stateString) {
+ stateString += ', '
+ }
+
+ // e.g. 'fetching IPFS from cloudflare-ipfs.com, ipfs.io'
+ const formattedState = state.replaceAll('-', ' ').replace('ipfs', 'IPFS').replace('ipns', 'IPNS')
+ stateString += `${formattedState} from ${clientHosts.join(', ')}`
+ }
+
+ // capitalize first letter
+ if (stateString) {
+ stateString = stateString.charAt(0).toUpperCase() + stateString.slice(1)
+ }
+
+ // if string is empty, return undefined instead
+ return stateString === '' ? undefined : stateString
+ }, [clients])
+}
+
+export default useStateString
\ No newline at end of file
diff --git a/src/utils/formatState.js b/src/utils/formatState.js
deleted file mode 100644
index 4218972e..00000000
--- a/src/utils/formatState.js
+++ /dev/null
@@ -1,27 +0,0 @@
-function formatState(str) {
- if (!str) {
- return null;
- }
-
- const formattedWords = str
- .replace(/-/g, " ")
- .split(" ")
- .map((word, index) => {
- word = word.toLowerCase();
- if (word === "ipfs" || word === "ipns") {
- return word.toUpperCase();
- } else if (index === 0) {
- return word.charAt(0).toUpperCase() + word.slice(1);
- } else {
- return word;
- }
- });
-
- if (formattedWords.includes("Failed")) {
- return formattedWords.join(" ") + ".";
- }
-
- return formattedWords.join(" ") + "...";
-}
-
-export default formatState;
\ No newline at end of file
diff --git a/yarn.lock b/yarn.lock
index 3594950f..4ca3a6ed 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2613,9 +2613,9 @@
mkdirp "^1.0.4"
rimraf "^3.0.2"
-"@plebbit/plebbit-js@https://github.com/plebbit/plebbit-js.git#1073e876f52514195e87512281a9d2d7bbefbd6c":
+"@plebbit/plebbit-js@https://github.com/plebbit/plebbit-js.git#bcf4ec7ba024fdd7dc0bb2fab76c27c93597dd50":
version "0.0.3"
- resolved "https://github.com/plebbit/plebbit-js.git#1073e876f52514195e87512281a9d2d7bbefbd6c"
+ resolved "https://github.com/plebbit/plebbit-js.git#bcf4ec7ba024fdd7dc0bb2fab76c27c93597dd50"
dependencies:
"@keyv/sqlite" "3.6.2"
"@plebbit/plebbit-logger" "github:plebbit/plebbit-logger"
@@ -2668,11 +2668,11 @@
dependencies:
debug "4.3.3"
-"@plebbit/plebbit-react-hooks@https://github.com/plebbit/plebbit-react-hooks.git#91ea5a494fde74836b085e912f671cc5489ecf09":
+"@plebbit/plebbit-react-hooks@https://github.com/plebbit/plebbit-react-hooks.git#e602eda8080f2b3449388c2d5868d6e6da60c8f6":
version "0.0.1"
- resolved "https://github.com/plebbit/plebbit-react-hooks.git#91ea5a494fde74836b085e912f671cc5489ecf09"
+ resolved "https://github.com/plebbit/plebbit-react-hooks.git#e602eda8080f2b3449388c2d5868d6e6da60c8f6"
dependencies:
- "@plebbit/plebbit-js" "https://github.com/plebbit/plebbit-js.git#1073e876f52514195e87512281a9d2d7bbefbd6c"
+ "@plebbit/plebbit-js" "https://github.com/plebbit/plebbit-js.git#bcf4ec7ba024fdd7dc0bb2fab76c27c93597dd50"
"@plebbit/plebbit-logger" "https://github.com/plebbit/plebbit-logger.git"
assert "2.0.0"
ethers "5.6.9"