From 93a90bd8904ffda3686c8308657f69b1782d6e24 Mon Sep 17 00:00:00 2001
From: crupest <crupest@outlook.com>
Date: Mon, 15 Feb 2021 01:08:05 +0800
Subject: refactor: Refactor timeline card.

---
 FrontEnd/src/app/views/timeline/TimelineDeleteDialog.tsx | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

(limited to 'FrontEnd/src/app/views/timeline/TimelineDeleteDialog.tsx')

diff --git a/FrontEnd/src/app/views/timeline/TimelineDeleteDialog.tsx b/FrontEnd/src/app/views/timeline/TimelineDeleteDialog.tsx
index f472c16a..dbca62ca 100644
--- a/FrontEnd/src/app/views/timeline/TimelineDeleteDialog.tsx
+++ b/FrontEnd/src/app/views/timeline/TimelineDeleteDialog.tsx
@@ -2,20 +2,20 @@ import React from "react";
 import { useHistory } from "react-router";
 import { Trans } from "react-i18next";
 
-import { getHttpTimelineClient } from "@/http/timeline";
+import { getHttpTimelineClient, HttpTimelineInfo } from "@/http/timeline";
 
 import OperationDialog from "../common/OperationDialog";
 
 interface TimelineDeleteDialog {
+  timeline: HttpTimelineInfo;
   open: boolean;
-  name: string;
   close: () => void;
 }
 
 const TimelineDeleteDialog: React.FC<TimelineDeleteDialog> = (props) => {
   const history = useHistory();
 
-  const { name } = props;
+  const { timeline } = props;
 
   return (
     <OperationDialog
@@ -36,14 +36,14 @@ const TimelineDeleteDialog: React.FC<TimelineDeleteDialog> = (props) => {
         },
       ]}
       inputValidator={([value]) => {
-        if (value !== name) {
+        if (value !== timeline.name) {
           return { 0: "timeline.deleteDialog.notMatch" };
         } else {
           return null;
         }
       }}
       onProcess={() => {
-        return getHttpTimelineClient().deleteTimeline(name);
+        return getHttpTimelineClient().deleteTimeline(timeline.name);
       }}
       onSuccessAndClose={() => {
         history.replace("/");
-- 
cgit v1.2.3

