From 07f117b09552397c5a5ea812ea4da2b1472a75bb Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Mon, 31 May 2021 21:56:09 -0500 Subject: add users lib --- src/web/src/lib/users.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/web/src/lib/users.js (limited to 'src/web') diff --git a/src/web/src/lib/users.js b/src/web/src/lib/users.js new file mode 100644 index 00000000..27b66f6e --- /dev/null +++ b/src/web/src/lib/users.js @@ -0,0 +1,13 @@ +import api from './api'; + +export const getInfo = ({ username }) => { + return api.get(`/peers/${username}/info`); +}; + +export const getStatus = ({ username }) => { + return api.get(`/peers/${username}/status`); +}; + +export const getEndpoint = ({ username }) => { + return api.get(`/peers/${username}/endpoint`); +}; \ No newline at end of file -- cgit v1.2.3 From 6e5f007bcf4ab5f69def191f0ed1b0b35fbdbf89 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Mon, 31 May 2021 21:56:31 -0500 Subject: rough in Users components --- src/web/src/components/Users/User.js | 28 +++++++++++++++++++++ src/web/src/components/Users/Users.css | 15 ++++++++++++ src/web/src/components/Users/Users.js | 45 ++++++++++++++++++++++++++++++++++ 3 files changed, 88 insertions(+) create mode 100644 src/web/src/components/Users/User.js create mode 100644 src/web/src/components/Users/Users.css create mode 100644 src/web/src/components/Users/Users.js (limited to 'src/web') diff --git a/src/web/src/components/Users/User.js b/src/web/src/components/Users/User.js new file mode 100644 index 00000000..9ee9043f --- /dev/null +++ b/src/web/src/components/Users/User.js @@ -0,0 +1,28 @@ +import { + Item, + Image +} from 'semantic-ui-react'; + +const User = ({ + username, + description, + hasFreeUploadSlot, + hasPicture, + picture, + queueLength, + uploadSlots, + updatedAt + }) => ( + + + + + {username} + + {description} + + + +); + +export default User; \ No newline at end of file diff --git a/src/web/src/components/Users/Users.css b/src/web/src/components/Users/Users.css new file mode 100644 index 00000000..e0d3f974 --- /dev/null +++ b/src/web/src/components/Users/Users.css @@ -0,0 +1,15 @@ +.users-container { + padding-left: 15px; + padding-right: 15px; + max-width: 1200px !important; + margin-left: auto !important; + margin-right: auto !important; +} + +.users-container:last-child { + margin-bottom: 17px; +} + +.users-segment { + margin-top: 15px !important; +} \ No newline at end of file diff --git a/src/web/src/components/Users/Users.js b/src/web/src/components/Users/Users.js new file mode 100644 index 00000000..fe367746 --- /dev/null +++ b/src/web/src/components/Users/Users.js @@ -0,0 +1,45 @@ +import React, { useState, useEffect } from 'react'; + +import { + Item, + Segment +} from 'semantic-ui-react'; +import User from './User'; + +import { get } from '../../lib/users'; + +import './Users.css'; + +const Users = (props) => { + const [user, setUser] = useState({}); + + useEffect(() => { + const fetchUser = async () => { + // const user = await get({ username: 'username' }); + // const [info, status, endpoint] = await Promise.all([ + // getInfo({ username }), + // getStatus({ username }), + // getEndpoint({ username }) + // ]); + + // console.log(info, status, endpoint) + // return { ...info.data, ...status.data, ...endpoint.data }; + console.log(user); + setUser(user); + } + + fetchUser(); + }, []); + + return ( +
+ + + + + +
+ ); +}; + +export default Users; \ No newline at end of file -- cgit v1.2.3 From 5602d6ae1046191ae350001408b7891a5c656ca2 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Mon, 31 May 2021 21:56:39 -0500 Subject: add navigation for Users --- src/web/src/components/App.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'src/web') diff --git a/src/web/src/components/App.js b/src/web/src/components/App.js index 46bbcf72..526e1706 100644 --- a/src/web/src/components/App.js +++ b/src/web/src/components/App.js @@ -6,6 +6,7 @@ import * as session from '../lib/session'; import './App.css'; import Search from './Search/Search'; import Browse from './Browse/Browse'; +import Users from './Users/Users'; import Transfers from './Transfers/Transfers'; import Chat from './Chat/Chat'; import LoginForm from './LoginForm'; @@ -122,11 +123,6 @@ class App extends Component { Uploads - - - Browse - - Rooms @@ -137,6 +133,16 @@ class App extends Component { Chat + + + Users + + + + + Browse + + {token !== tokenPassthroughValue && @@ -152,9 +158,10 @@ class App extends Component { + this.withTokenCheck()}/> + this.withTokenCheck()}/> this.withTokenCheck()}/> this.withTokenCheck()}/> - this.withTokenCheck()}/> this.withTokenCheck()}/> this.withTokenCheck()}/> this.withTokenCheck()}/> -- cgit v1.2.3 From 0d9fa7dbd8efa3c1f3d4bff5dc3ccbdc423472e1 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Tue, 1 Jun 2021 08:58:33 -0500 Subject: set users icon --- src/web/src/components/App.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/web') diff --git a/src/web/src/components/App.js b/src/web/src/components/App.js index 526e1706..26ff028d 100644 --- a/src/web/src/components/App.js +++ b/src/web/src/components/App.js @@ -135,7 +135,7 @@ class App extends Component { - Users + Users -- cgit v1.2.3 From a1af7d575d8c20677626b3b2234985a0b2f48bae Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Tue, 1 Jun 2021 08:58:52 -0500 Subject: add selection input --- src/web/src/components/Users/User.js | 5 +-- src/web/src/components/Users/Users.css | 12 ++++++- src/web/src/components/Users/Users.js | 64 +++++++++++++++++++++++++--------- 3 files changed, 61 insertions(+), 20 deletions(-) (limited to 'src/web') diff --git a/src/web/src/components/Users/User.js b/src/web/src/components/Users/User.js index 9ee9043f..2e597201 100644 --- a/src/web/src/components/Users/User.js +++ b/src/web/src/components/Users/User.js @@ -11,10 +11,11 @@ const User = ({ picture, queueLength, uploadSlots, - updatedAt + updatedAt, + fetching }) => ( - + {username} diff --git a/src/web/src/components/Users/Users.css b/src/web/src/components/Users/Users.css index e0d3f974..a5c7b048 100644 --- a/src/web/src/components/Users/Users.css +++ b/src/web/src/components/Users/Users.css @@ -10,6 +10,16 @@ margin-bottom: 17px; } -.users-segment { +.users-selection { margin-top: 15px !important; + height: 78px !important; +} + +.users-input { + width: 100%; +} + +.users-user { + margin-top: 15px !important; + min-height: 78px; } \ No newline at end of file diff --git a/src/web/src/components/Users/Users.js b/src/web/src/components/Users/Users.js index fe367746..e6957be1 100644 --- a/src/web/src/components/Users/Users.js +++ b/src/web/src/components/Users/Users.js @@ -2,42 +2,72 @@ import React, { useState, useEffect } from 'react'; import { Item, - Segment + Segment, + Input } from 'semantic-ui-react'; import User from './User'; -import { get } from '../../lib/users'; +import { getInfo, getStatus, getEndpoint } from '../../lib/users'; import './Users.css'; const Users = (props) => { - const [user, setUser] = useState({}); + const [user, setUser] = useState(); + const [usernameInput, setUsernameInput] = useState(); + const [selectedUsername, setSelectedUsername] = useState(undefined); + const [{ fetching, error }, setStatus] = useState({ fetching: false, error: undefined }); + useEffect(() => { const fetchUser = async () => { - // const user = await get({ username: 'username' }); - // const [info, status, endpoint] = await Promise.all([ - // getInfo({ username }), - // getStatus({ username }), - // getEndpoint({ username }) - // ]); - - // console.log(info, status, endpoint) - // return { ...info.data, ...status.data, ...endpoint.data }; - console.log(user); - setUser(user); + if (selectedUsername === undefined) { + return; + } + + setStatus({ fetching: true, error: undefined }); + + try { + const [info, status, endpoint] = await Promise.all([ + getInfo({ username: selectedUsername }), + getStatus({ username: selectedUsername }), + getEndpoint({ username: selectedUsername }) + ]); + + setUser({ ...info.data, ...status.data, ...endpoint.data }); + setStatus({ fetching: false, error: undefined }); + } catch (error) { + setStatus({ fetching: false, error: error }); + } } fetchUser(); - }, []); + }, [selectedUsername]); + + const clear = () => { + setSelectedUsername(undefined); + setUser(undefined); + } return (
- + + } + size='big' + loading={fetching} + disabled={fetching} + className='users-input' + placeholder="Username" + onChange={(e) => setUsernameInput(e.target.value)} + action={!fetching && (!user ? { icon: 'search', onClick: () => setSelectedUsername(usernameInput) } : { icon: 'x', color: 'red', onClick: clear })} + onKeyUp={(e) => e.key === 'Enter' ? setSelectedUsername() : ''} + /> + + {!fetching && !error && !!user && - + }
); }; -- cgit v1.2.3 From aeb48015536ee347b91798a637c8e993a4889fd2 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Wed, 2 Jun 2021 09:27:41 -0500 Subject: add image placeholder, basic stats --- src/web/src/components/Users/User.js | 42 ++++++++++++++++++++++++++-------- src/web/src/components/Users/Users.css | 11 +++++++++ 2 files changed, 43 insertions(+), 10 deletions(-) (limited to 'src/web') diff --git a/src/web/src/components/Users/User.js b/src/web/src/components/Users/User.js index 2e597201..be1d6443 100644 --- a/src/web/src/components/Users/User.js +++ b/src/web/src/components/Users/User.js @@ -1,8 +1,13 @@ import { Item, - Image + Icon, + Divider, + Button } from 'semantic-ui-react'; +const ImagePlaceholder = () => + (
); + const User = ({ username, description, @@ -14,16 +19,33 @@ const User = ({ updatedAt, fetching }) => ( - - + <> + + {hasPicture ? + + : } + + + {username} + + Free Upload Slot: , Total Upload Slots: {uploadSlots}, Queue Length: {queueLength} + + + {description || 'No user info.'} + +
- - {username} - - {description} - - - +
+
+
+ +
+ +
+ ); export default User; \ No newline at end of file diff --git a/src/web/src/components/Users/Users.css b/src/web/src/components/Users/Users.css index a5c7b048..29e31f48 100644 --- a/src/web/src/components/Users/Users.css +++ b/src/web/src/components/Users/Users.css @@ -22,4 +22,15 @@ .users-user { margin-top: 15px !important; min-height: 78px; +} + +.users-picture-placeholder { + text-align: center; + padding-top: 10px !important; + opacity: .125; +} + +.ui.items > .item > .content > .description { + white-space: pre-wrap; + margin-top: 15px; } \ No newline at end of file -- cgit v1.2.3 From 19ed1ff413d92c19a719ca19ec3afaa92bc272ed Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Thu, 3 Jun 2021 16:40:49 -0500 Subject: add key events, status indicator --- src/web/src/lib/peers.js | 13 +++++++++++++ src/web/src/lib/users.js | 13 ------------- 2 files changed, 13 insertions(+), 13 deletions(-) create mode 100644 src/web/src/lib/peers.js delete mode 100644 src/web/src/lib/users.js (limited to 'src/web') diff --git a/src/web/src/lib/peers.js b/src/web/src/lib/peers.js new file mode 100644 index 00000000..fd5fe44f --- /dev/null +++ b/src/web/src/lib/peers.js @@ -0,0 +1,13 @@ +import api from './api'; + +export const getInfo = ({ username, bypassCache = false }) => { + return api.get(`/peers/${username}/info?bypassCache=${bypassCache}`); +}; + +export const getStatus = ({ username }) => { + return api.get(`/peers/${username}/status`); +}; + +export const getEndpoint = ({ username }) => { + return api.get(`/peers/${username}/endpoint`); +}; \ No newline at end of file diff --git a/src/web/src/lib/users.js b/src/web/src/lib/users.js deleted file mode 100644 index 27b66f6e..00000000 --- a/src/web/src/lib/users.js +++ /dev/null @@ -1,13 +0,0 @@ -import api from './api'; - -export const getInfo = ({ username }) => { - return api.get(`/peers/${username}/info`); -}; - -export const getStatus = ({ username }) => { - return api.get(`/peers/${username}/status`); -}; - -export const getEndpoint = ({ username }) => { - return api.get(`/peers/${username}/endpoint`); -}; \ No newline at end of file -- cgit v1.2.3 From 09c9808cab061653327f327df771fa189cb8fa6c Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Thu, 3 Jun 2021 16:41:46 -0500 Subject: add presence indicator --- src/web/src/components/Users/User.js | 40 +++++++++++++++++++++-------------- src/web/src/components/Users/Users.js | 33 ++++++++++++++++++----------- 2 files changed, 45 insertions(+), 28 deletions(-) (limited to 'src/web') diff --git a/src/web/src/components/Users/User.js b/src/web/src/components/Users/User.js index be1d6443..8e76cf7c 100644 --- a/src/web/src/components/Users/User.js +++ b/src/web/src/components/Users/User.js @@ -1,13 +1,28 @@ import { Item, - Icon, - Divider, - Button + Icon } from 'semantic-ui-react'; const ImagePlaceholder = () => (
); +const Presence = ({ presence }) => { + console.log(presence); + const colors = { + Away: 'yellow', + Online: 'green' + } + + return +}; + +const FreeUploadSlot = ({ hasFreeUploadSlot }) => ( + +); + const User = ({ username, description, @@ -17,7 +32,10 @@ const User = ({ queueLength, uploadSlots, updatedAt, - fetching + isPrivileged, + presence, + address, + port, }) => ( <> @@ -26,25 +44,15 @@ const User = ({ : } - {username} + {username} - Free Upload Slot: , Total Upload Slots: {uploadSlots}, Queue Length: {queueLength} + Free Upload Slot: , Total Upload Slots: {uploadSlots}, Queue Length: {queueLength}, IP Address: {address}, Port: {port} {description || 'No user info.'} -
- -
- -
- -
); diff --git a/src/web/src/components/Users/Users.js b/src/web/src/components/Users/Users.js index e6957be1..99bd96a1 100644 --- a/src/web/src/components/Users/Users.js +++ b/src/web/src/components/Users/Users.js @@ -1,4 +1,4 @@ -import React, { useState, useEffect } from 'react'; +import React, { useState, useEffect, useLayoutEffect } from 'react'; import { Item, @@ -7,7 +7,7 @@ import { } from 'semantic-ui-react'; import User from './User'; -import { getInfo, getStatus, getEndpoint } from '../../lib/users'; +import { getInfo, getStatus, getEndpoint } from '../../lib/peers'; import './Users.css'; @@ -17,6 +17,13 @@ const Users = (props) => { const [selectedUsername, setSelectedUsername] = useState(undefined); const [{ fetching, error }, setStatus] = useState({ fetching: false, error: undefined }); + useEffect(() => { + document.addEventListener("keyup", keyUp, false); + }, []); + + useLayoutEffect(() => { + document.removeEventListener('keyup', keyUp, false); + }, []); useEffect(() => { const fetchUser = async () => { @@ -28,7 +35,7 @@ const Users = (props) => { try { const [info, status, endpoint] = await Promise.all([ - getInfo({ username: selectedUsername }), + getInfo({ username: selectedUsername, bypassCache: true }), getStatus({ username: selectedUsername }), getEndpoint({ username: selectedUsername }) ]); @@ -48,19 +55,21 @@ const Users = (props) => { setUser(undefined); } + const keyUp = (e) => e.key === 'Escape' ? clear() : ''; + return (
} - size='big' - loading={fetching} - disabled={fetching} - className='users-input' - placeholder="Username" - onChange={(e) => setUsernameInput(e.target.value)} - action={!fetching && (!user ? { icon: 'search', onClick: () => setSelectedUsername(usernameInput) } : { icon: 'x', color: 'red', onClick: clear })} - onKeyUp={(e) => e.key === 'Enter' ? setSelectedUsername() : ''} + input={} + size='big' + loading={fetching} + disabled={fetching} + className='users-input' + placeholder="Username" + onChange={(e) => setUsernameInput(e.target.value)} + action={!fetching && (!user ? { icon: 'search', onClick: () => setSelectedUsername(usernameInput) } : { icon: 'x', color: 'red', onClick: clear })} + onKeyUp={(e) => e.key === 'Enter' ? setSelectedUsername(usernameInput) : ''} /> {!fetching && !error && !!user && -- cgit v1.2.3 From a67d368b3f6970b3c8f674606a1df9ad70f72062 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Thu, 3 Jun 2021 17:13:23 -0500 Subject: dont log presence --- src/web/src/components/Users/User.js | 1 - 1 file changed, 1 deletion(-) (limited to 'src/web') diff --git a/src/web/src/components/Users/User.js b/src/web/src/components/Users/User.js index 8e76cf7c..e196844e 100644 --- a/src/web/src/components/Users/User.js +++ b/src/web/src/components/Users/User.js @@ -7,7 +7,6 @@ const ImagePlaceholder = () => (
); const Presence = ({ presence }) => { - console.log(presence); const colors = { Away: 'yellow', Online: 'green' -- cgit v1.2.3 From a96cc204c4df5d695f23f952dc150b55be2d1f40 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 5 Jun 2021 18:02:32 -0500 Subject: add localStorage --- src/web/src/components/Users/Users.js | 33 +++++++++++++++++++++++++++------ src/web/src/config.js | 6 ++++-- 2 files changed, 31 insertions(+), 8 deletions(-) (limited to 'src/web') diff --git a/src/web/src/components/Users/Users.js b/src/web/src/components/Users/Users.js index 99bd96a1..bd2c6bd2 100644 --- a/src/web/src/components/Users/Users.js +++ b/src/web/src/components/Users/Users.js @@ -1,17 +1,18 @@ -import React, { useState, useEffect, useLayoutEffect } from 'react'; - +import React, { useState, useEffect, useLayoutEffect, useRef } from 'react'; import { Item, Segment, Input } from 'semantic-ui-react'; -import User from './User'; +import User from './User'; import { getInfo, getStatus, getEndpoint } from '../../lib/peers'; +import { activeUserInfoKey } from '../../config'; import './Users.css'; const Users = (props) => { + const inputRef = useRef(); const [user, setUser] = useState(); const [usernameInput, setUsernameInput] = useState(); const [selectedUsername, setSelectedUsername] = useState(undefined); @@ -19,15 +20,22 @@ const Users = (props) => { useEffect(() => { document.addEventListener("keyup", keyUp, false); - }, []); + + const storedUsername = localStorage.getItem(activeUserInfoKey); + + if (storedUsername !== undefined) { + setSelectedUsername(storedUsername); + setInputText(storedUsername); + } + }, []); // eslint-disable-line react-hooks/exhaustive-deps useLayoutEffect(() => { document.removeEventListener('keyup', keyUp, false); - }, []); + }, []); // eslint-disable-line react-hooks/exhaustive-deps useEffect(() => { const fetchUser = async () => { - if (selectedUsername === undefined) { + if (!selectedUsername) { return; } @@ -40,6 +48,7 @@ const Users = (props) => { getEndpoint({ username: selectedUsername }) ]); + localStorage.setItem(activeUserInfoKey, selectedUsername); setUser({ ...info.data, ...status.data, ...endpoint.data }); setStatus({ fetching: false, error: undefined }); } catch (error) { @@ -51,8 +60,19 @@ const Users = (props) => { }, [selectedUsername]); const clear = () => { + localStorage.removeItem(activeUserInfoKey); setSelectedUsername(undefined); setUser(undefined); + setInputText(''); + setInputFocus(); + } + + const setInputText = (text) => { + inputRef.current.inputRef.current.value = text; + } + + const setInputFocus = () => { + inputRef.current.focus(); } const keyUp = (e) => e.key === 'Escape' ? clear() : ''; @@ -65,6 +85,7 @@ const Users = (props) => { size='big' loading={fetching} disabled={fetching} + ref={inputRef} className='users-input' placeholder="Username" onChange={(e) => setUsernameInput(e.target.value)} diff --git a/src/web/src/config.js b/src/web/src/config.js index f59fbcd8..4d6522e3 100644 --- a/src/web/src/config.js +++ b/src/web/src/config.js @@ -2,12 +2,14 @@ const baseUrl = process.env.NODE_ENV === 'production' ? 'api/v0' : 'http://local const tokenKey = 'slskd-token'; const tokenPassthroughValue = 'n/a'; const activeChatKey = 'slskd-active-chat'; -const activeRoomKey = 'sslskd-active-room'; +const activeRoomKey = 'slskd-active-room'; +const activeUserInfoKey = 'slskd-active-user'; export { baseUrl, tokenKey, tokenPassthroughValue, activeChatKey, - activeRoomKey + activeRoomKey, + activeUserInfoKey }; -- cgit v1.2.3 From 1c4ac8c40efe62db67328553d5d0eabc6bc299f9 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 5 Jun 2021 18:10:23 -0500 Subject: fix browse --- src/web/src/components/Browse/Browse.js | 6 +++--- src/web/src/components/Users/Users.js | 8 ++++---- src/web/src/lib/peers.js | 8 ++++++++ src/web/src/lib/user.js | 9 --------- 4 files changed, 15 insertions(+), 16 deletions(-) delete mode 100644 src/web/src/lib/user.js (limited to 'src/web') diff --git a/src/web/src/components/Browse/Browse.js b/src/web/src/components/Browse/Browse.js index c9e13b7e..295b234e 100644 --- a/src/web/src/components/Browse/Browse.js +++ b/src/web/src/components/Browse/Browse.js @@ -1,5 +1,5 @@ import React, { Component } from 'react'; -import * as user from '../../lib/user'; +import * as peers from '../../lib/peers'; import './Browse.css'; @@ -40,7 +40,7 @@ class Browse extends Component { let username = this.inputtext.inputRef.current.value; this.setState({ username , browseState: 'pending', browseError: undefined }, () => { - user.browse({ username }) + peers.browse({ username }) .then(response => { let { directories, lockedDirectories } = response; @@ -116,7 +116,7 @@ class Browse extends Component { fetchStatus = () => { const { browseState, username } = this.state; if (browseState === 'pending') { - user.getBrowseStatus({ username }) + peers.getBrowseStatus({ username }) .then(response => this.setState({ browseStatus: response.data })); diff --git a/src/web/src/components/Users/Users.js b/src/web/src/components/Users/Users.js index bd2c6bd2..37d9d82b 100644 --- a/src/web/src/components/Users/Users.js +++ b/src/web/src/components/Users/Users.js @@ -6,8 +6,8 @@ import { } from 'semantic-ui-react'; import User from './User'; -import { getInfo, getStatus, getEndpoint } from '../../lib/peers'; import { activeUserInfoKey } from '../../config'; +import * as peers from '../../lib/peers'; import './Users.css'; @@ -43,9 +43,9 @@ const Users = (props) => { try { const [info, status, endpoint] = await Promise.all([ - getInfo({ username: selectedUsername, bypassCache: true }), - getStatus({ username: selectedUsername }), - getEndpoint({ username: selectedUsername }) + peers.getInfo({ username: selectedUsername, bypassCache: true }), + peers.getStatus({ username: selectedUsername }), + peers.getEndpoint({ username: selectedUsername }) ]); localStorage.setItem(activeUserInfoKey, selectedUsername); diff --git a/src/web/src/lib/peers.js b/src/web/src/lib/peers.js index fd5fe44f..8cbc1c1b 100644 --- a/src/web/src/lib/peers.js +++ b/src/web/src/lib/peers.js @@ -10,4 +10,12 @@ export const getStatus = ({ username }) => { export const getEndpoint = ({ username }) => { return api.get(`/peers/${username}/endpoint`); +}; + +export const browse = async ({ username }) => { + return (await api.get(`/peers/${username}/browse`)).data; +}; + +export const getBrowseStatus = ({ username }) => { + return api.get(`/peers/${username}/browse/status`); }; \ No newline at end of file diff --git a/src/web/src/lib/user.js b/src/web/src/lib/user.js deleted file mode 100644 index 6833c193..00000000 --- a/src/web/src/lib/user.js +++ /dev/null @@ -1,9 +0,0 @@ -import api from './api'; - -export const browse = async ({ username }) => { - return (await api.get(`/user/${username}/browse`)).data; -}; - -export const getBrowseStatus = ({ username }) => { - return api.get(`/user/${username}/browse/status`); -}; \ No newline at end of file -- cgit v1.2.3