diff --git a/src/img/icons/cross.svg b/src/img/icons/cross.svg deleted file mode 100644 index c94691d..0000000 --- a/src/img/icons/cross.svg +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/src/img/icons/tick.svg b/src/img/icons/tick.svg deleted file mode 100644 index 89657e6..0000000 --- a/src/img/icons/tick.svg +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/src/lang/en_GB.json b/src/lang/en_GB.json index 52db85b..cf52f3e 100644 --- a/src/lang/en_GB.json +++ b/src/lang/en_GB.json @@ -23,7 +23,6 @@ "navigation": { "timeline": "Timeline", "notifications": "Notifications", - "follow_requests": "Follow requests", "explore": "Explore", "lists": "Lists", @@ -38,10 +37,6 @@ "back": "Back" }, - "follow_requests": { - "none": "no follow requests to action right now!" - }, - "timeline": { "home": "Home", "local": "Local", diff --git a/src/lib/api.js b/src/lib/api.js index 07644a3..d5cfbb8 100644 --- a/src/lib/api.js +++ b/src/lib/api.js @@ -176,66 +176,6 @@ export async function getNotifications(host, token, min_id, max_id, limit, types return data; } -/** - * GET /api/v1/follow_requests - * @param {string} host - The domain of the target server. - * @param {string} token - The application token. - * @param {string} min_id - If provided, only shows follow requests since this ID. - * @param {string} max_id - If provided, only shows follow requests before this ID. - * @param {string} limit - The maximum number of follow requests to retrieve (default 40, max 80). - */ -export async function getFollowRequests(host, token, since_id, max_id, limit) { - let url = `https://${host}/api/v1/follow_requests`; - - let params = new URLSearchParams(); - if (since_id) params.append("since_id", since_id); - if (max_id) params.append("max_id", max_id); - if (limit) params.append("limit", limit); - const params_string = params.toString(); - if (params_string) url += '?' + params_string; - - const data = await fetch(url, { - method: 'GET', - headers: { "Authorization": "Bearer " + token } - }).then(res => res.json()); - - return data; -} - -/** - * POST /api/v1/follow_requests/:account_id/authorize - * @param {string} host - The domain of the target server. - * @param {string} token - The application token. - * @param {string} account_id - The account ID of the follow request to accept - */ -export async function acceptFollowRequest(host, token, account_id) { - let url = `https://${host}/api/v1/follow_requests/${account_id}/authorize`; - - const data = await fetch(url, { - method: 'POST', - headers: { "Authorization": "Bearer " + token } - }).then(res => res.json()); - - return data; -} - -/** - * POST /api/v1/follow_requests/:account_id/reject - * @param {string} host - The domain of the target server. - * @param {string} token - The application token. - * @param {string} account_id - The account ID of the follow request to reject - */ -export async function rejectFollowRequest(host, token, account_id) { - let url = `https://${host}/api/v1/follow_requests/${account_id}/reject`; - - const data = await fetch(url, { - method: 'POST', - headers: { "Authorization": "Bearer " + token } - }).then(res => res.json()); - - return data; -} - /** * GET /api/v1/timelines/{timeline} * @param {string} host - The domain of the target server. diff --git a/src/lib/followRequests.js b/src/lib/followRequests.js deleted file mode 100644 index 38a4e2d..0000000 --- a/src/lib/followRequests.js +++ /dev/null @@ -1,28 +0,0 @@ -import { server } from './client/server.js'; -import { writable } from "svelte/store"; -import * as api from "./api.js"; -import { app } from './client/app.js'; -import { get } from 'svelte/store'; -import { parseAccount } from './account.js'; - -// Cache for all requests -export let followRequests = writable(); - -/** - * Gets all follow requests - * @param {boolean} force - */ -export async function fetchFollowRequests(force) { - // if already cached, return for now - if(!get(followRequests) && !force) return; - - let newReqs = await api.getFollowRequests( - get(server).host, - get(app).token - ); - - // parse accounts - newReqs = newReqs.map((r) => parseAccount(r)); - - followRequests.set(newReqs); -} \ No newline at end of file diff --git a/src/lib/ui/Button.svelte b/src/lib/ui/Button.svelte index cc720c8..b6b63f4 100644 --- a/src/lib/ui/Button.svelte +++ b/src/lib/ui/Button.svelte @@ -154,7 +154,8 @@ a.disabled, button.disabled { color: var(--text); - opacity: .35; + opacity: .5; + background: transparent; border-color: transparent; cursor: not-allowed; } diff --git a/src/lib/ui/Navigation.svelte b/src/lib/ui/Navigation.svelte index 41b2f8e..d67f391 100644 --- a/src/lib/ui/Navigation.svelte +++ b/src/lib/ui/Navigation.svelte @@ -6,9 +6,8 @@ import { playSound } from '$lib/sound.js'; import { goto } from '$app/navigation'; import { page } from '$app/stores'; - import { createEventDispatcher, onMount } from 'svelte'; + import { createEventDispatcher } from 'svelte'; import { unread_notif_count } from '$lib/notifications.js'; - import { fetchFollowRequests, followRequests } from '$lib/followRequests.js' import Lang from '$lib/lang'; import Logo from '$lib/../img/campfire-logo.svg'; @@ -25,7 +24,6 @@ import InfoIcon from '../../img/icons/info.svg'; import SettingsIcon from '../../img/icons/settings.svg'; import LogoutIcon from '../../img/icons/logout.svg'; - import FollowersIcon from '../../img/icons/followers.svg'; const VERSION = APP_VERSION; const lang = Lang('en_GB'); @@ -42,7 +40,7 @@ goto(`/${$server.host}/${$account.username}`); } - async function logOut() { + async function log_out() { if (!confirm("This will log you out. Are you sure?")) return; const res = await api.revokeToken( @@ -61,10 +59,6 @@ goto("/"); } - - onMount(async () => { - await fetchFollowRequests(true) - })