Files
Folo/apps/desktop/layer/renderer/src/lib/url-builder.ts
T
Innei 059ab9d996 refactor(desktop): update SharePanel and UrlBuilder for improved share URL handling
- Refactored SharePanel to retrieve the share URL directly from the entry data.
- Enhanced UrlBuilder with a new method for generating share URLs that includes view and subscription parameters.
- Updated the shareEntry method to utilize the new structure for better flexibility.

Signed-off-by: Innei <tukon479@gmail.com>
2025-06-06 18:43:45 +08:00

25 lines
594 B
TypeScript

import { FeedViewType } from "@follow/constants"
import { UrlBuilder as UrlBuilderClass } from "@follow/utils/url-builder"
import { WEB_URL } from "~/constants/env"
class WebUrlBuilder extends UrlBuilderClass {
constructor() {
super(WEB_URL)
}
shareEntry(
id: string,
options?: {
view?: FeedViewType
subscriptionId?: string
},
) {
const { view = FeedViewType.Articles, subscriptionId = "all" } = options || {}
return super.join(`timeline/view-${view}/${subscriptionId}/${id}`, { share: "1" })
}
}
export const UrlBuilder = new WebUrlBuilder()