fix: add feed from url, close #686
This commit is contained in:
@@ -24,10 +24,11 @@ export const handleUrlRouting = (url: string) => {
|
||||
mainWindow.focus()
|
||||
const caller = callWindowExpose(mainWindow)
|
||||
|
||||
const id = searchParams.get("id")
|
||||
const id = searchParams.get("id") ?? undefined
|
||||
const isList = searchParams.get("type") === "list"
|
||||
if (!id) return
|
||||
caller.follow(id, { isList })
|
||||
const urlParam = searchParams.get("url") ?? undefined
|
||||
if (!id && !url) return
|
||||
caller.follow({ isList, id, url: urlParam })
|
||||
return
|
||||
}
|
||||
default: {
|
||||
|
||||
@@ -33,13 +33,19 @@ export const ExtensionExposeProvider = () => {
|
||||
const presentUserProfile = usePresentUserProfileModal("dialog")
|
||||
useEffect(() => {
|
||||
registerGlobalContext({
|
||||
follow(id, options) {
|
||||
follow(options) {
|
||||
present({
|
||||
title: options?.isList
|
||||
? t("sidebar.feed_actions.edit_list")
|
||||
: t("sidebar.feed_actions.edit_feed"),
|
||||
content: ({ dismiss }) => (
|
||||
<FeedForm asWidget id={id} onSuccess={dismiss} isList={options?.isList} />
|
||||
<FeedForm
|
||||
asWidget
|
||||
id={options?.id}
|
||||
url={options?.url}
|
||||
onSuccess={dismiss}
|
||||
isList={options?.isList}
|
||||
/>
|
||||
),
|
||||
})
|
||||
},
|
||||
|
||||
@@ -21,7 +21,7 @@ interface RenderGlobalContext {
|
||||
onWindowShow: () => void
|
||||
|
||||
/// Actions
|
||||
follow: (id: string, options?: { isList: boolean }) => void
|
||||
follow: (options?: { isList: boolean; id?: string; url?: string }) => void
|
||||
profile: (id: string, variant?: "drawer" | "dialog") => void
|
||||
|
||||
/// Utils
|
||||
|
||||
Reference in New Issue
Block a user