resolve toast bug and complete request part and sorting data
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { createContext, useEffect, useState } from "react";
|
||||
import { toast } from "react-toastify";
|
||||
import AskForKeepData from "@/core/components/NotificationDesign/AskForKeepData";
|
||||
import useTableSetting from "@/lib/hooks/useTableSetting";
|
||||
import { flattenArrayOfObjects } from "@/core/utils/flattenArrayOfObjects";
|
||||
import AskForKeepData from "@/core/components/NotificationDesign/AskForKeepData";
|
||||
|
||||
export const DataTableContext = createContext();
|
||||
|
||||
@@ -58,7 +58,7 @@ const DataTableProvider = ({ children, user_id, page_name, table_name, columns }
|
||||
JSON.stringify(initFilter) !== JSON.stringify(filterData) ||
|
||||
JSON.stringify(initSort) !== JSON.stringify(sortData)
|
||||
) {
|
||||
if (!toast.isActive("keep_data", "datatable")) {
|
||||
if (!toast.isActive("keep_data", "filtering")) {
|
||||
toast(
|
||||
<AskForKeepData
|
||||
filterData={filterData}
|
||||
@@ -69,7 +69,7 @@ const DataTableProvider = ({ children, user_id, page_name, table_name, columns }
|
||||
columns={flatColumns}
|
||||
/>,
|
||||
{
|
||||
containerId: "datatable",
|
||||
containerId: "filtering",
|
||||
toastId: "keep_data",
|
||||
className: "filter-toast",
|
||||
position: "bottom-left",
|
||||
@@ -79,7 +79,7 @@ const DataTableProvider = ({ children, user_id, page_name, table_name, columns }
|
||||
);
|
||||
} else {
|
||||
toast.update("keep_data", {
|
||||
containerId: "datatable",
|
||||
containerId: "filtering",
|
||||
toastId: "keep_data",
|
||||
render: (
|
||||
<AskForKeepData
|
||||
|
||||
Reference in New Issue
Block a user