Admiral Patrick

I’m surprisingly level-headed for being a walking knot of anxiety.

Ask me anything.

I also develop Tesseract UI for Lemmy/Sublinks

Avatar by @SatyrSack@feddit.org

  • 478 Posts
  • 4.1K Comments
Joined 2 years ago
cake
Cake day: June 6th, 2023

help-circle













  • My instance already blocks hex, grad, and ml, so I’m halfway there lol.

    The politics/news communities here, though, are present but highly curated since many of them do not meet our standards for preventing misinformation. Seriously, our rules are very strict after I first got started with Lemmy and saw what a complete shit show worldnews at .ml was.

    Defederating from the big 3 “extreme” instances is one thing and very doable. The problem with running a dedicated “no news/politics” instance would be preventing users from subscribing to any. The admin would have to on top of every news community that shows up and then administratively remove/hide those. That’s going to be a chore.







  • To get the current logged-in user’s details, that’s actually retrieved from /api/v3/site for…reasons, I guess?

    Your function can remain the same, but change the api endpoint to /site Also, the user details will be in the my_user key from get site response.

    Is there a reason you’re not using the lemmy-js-client? That will take care of a lot of the low-level fetching for you (and has TypeDocs which help you to know what response / form data is needed).

    Your Original Function, Slightly Modified

     async function getLoggined() {
       try {
            const response = await fetch(`${api}/site`, {
                method: "GET",
                headers: {
                    "Content-Type": "application/json",
                    "Authorization": `Bearer ${lemmyToken}`
                }
            });
            alert(`Bearer ${lemmyToken}`);
            alert(await response.text());
            const data = await response.json();
            return data.my_user;
        } catch (error) {
            alert(`error while loading profile: ${error}`);
        }
    }