Browse Source

支持设置channel与url channel合并

visuddhinanda 1 year ago
parent
commit
3da6797d0f
1 changed files with 6 additions and 1 deletions
  1. 6 1
      dashboard-v4/dashboard/src/components/template/Article.tsx

+ 6 - 1
dashboard-v4/dashboard/src/components/template/Article.tsx

@@ -59,6 +59,11 @@ export const ArticleCtl = ({
     currMode = mode;
   }
 
+  const orgChannels = channel ? channel.split(",") : [];
+  const strUrlChannels = searchParams.get("channel");
+  const urlChannels = strUrlChannels ? strUrlChannels.split(",") : [];
+  const currChannels = [...orgChannels, ...urlChannels];
+
   const showModal = () => {
     setIsModalOpen(true);
   };
@@ -80,7 +85,7 @@ export const ArticleCtl = ({
       anthologyId={anthology}
       book={book}
       para={paragraphs}
-      channelId={channel}
+      channelId={currChannels.join(",")}
       parentChannels={parentChannels}
       focus={focus}
       mode={currMode}