fix: dont import serverside bsky uri parsing code to clientside
All checks were successful
create archive with lfs / tag (push) Successful in 10s
All checks were successful
create archive with lfs / tag (push) Successful in 10s
This commit is contained in:
parent
ab37a70708
commit
8a6ad6133e
@ -13,13 +13,6 @@ export const getBskyClient = async () => {
|
|||||||
return client
|
return client
|
||||||
}
|
}
|
||||||
|
|
||||||
export const parseAtUri = (uri: string) => {
|
|
||||||
if (uri.startsWith("https://bsky.gaze.systems")) {
|
|
||||||
return uri
|
|
||||||
}
|
|
||||||
return `https://bsky.gaze.systems/post/${uri.split('/').pop()}`
|
|
||||||
}
|
|
||||||
|
|
||||||
const loginToBsky = async () => {
|
const loginToBsky = async () => {
|
||||||
const bot = new Bot({ service: "https://bsky.social" })
|
const bot = new Bot({ service: "https://bsky.social" })
|
||||||
await bot.login({ identifier: 'gaze.systems', password: env.BSKY_PASSWORD ?? "" })
|
await bot.login({ identifier: 'gaze.systems', password: env.BSKY_PASSWORD ?? "" })
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Window from '../../components/window.svelte';
|
import Window from '../../components/window.svelte';
|
||||||
import Token from '../../components/token.svelte';
|
import Token from '../../components/token.svelte';
|
||||||
import { parseAtUri } from '$lib/bluesky.js';
|
|
||||||
|
|
||||||
export let data;
|
export let data;
|
||||||
|
|
||||||
@ -19,7 +18,10 @@
|
|||||||
|
|
||||||
const getOutgoingLink = (name: string, link: string) => {
|
const getOutgoingLink = (name: string, link: string) => {
|
||||||
if (name === "bsky") {
|
if (name === "bsky") {
|
||||||
return parseAtUri(link)
|
if (link.startsWith("https://bsky.gaze.systems")) {
|
||||||
|
return link
|
||||||
|
}
|
||||||
|
return `https://bsky.gaze.systems/post/${link.split('/').pop()}`
|
||||||
}
|
}
|
||||||
return link
|
return link
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user