mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-17 19:37:02 +00:00
improvement: check all users tickets as active by default
This commit is contained in:
@@ -21,7 +21,6 @@ import { AuthContext } from "../../context/Auth/AuthContext";
|
||||
import { Can } from "../Can";
|
||||
import TicketsQueueSelect from "../TicketsQueueSelect";
|
||||
import { Button } from "@material-ui/core";
|
||||
import { useLocalStorage } from "../../hooks/useLocalStorage";
|
||||
|
||||
const useStyles = makeStyles(theme => ({
|
||||
ticketsWrapper: {
|
||||
@@ -88,12 +87,11 @@ const TicketsManager = () => {
|
||||
const [tab, setTab] = useState("open");
|
||||
const [newTicketModalOpen, setNewTicketModalOpen] = useState(false);
|
||||
const [showAllTickets, setShowAllTickets] = useState(false);
|
||||
const { user } = useContext(AuthContext);
|
||||
const searchInputRef = useRef();
|
||||
const [selectedQueueIds, setSelectedQueueIds] = useLocalStorage(
|
||||
"selectedQueueIds",
|
||||
[]
|
||||
);
|
||||
const { user } = useContext(AuthContext);
|
||||
|
||||
const userQueueIds = user.queues.map(q => q.id);
|
||||
const [selectedQueueIds, setSelectedQueueIds] = useState(userQueueIds || []);
|
||||
|
||||
useEffect(() => {
|
||||
if (tab === "search") {
|
||||
|
||||
@@ -13,6 +13,7 @@ export function useLocalStorage(key, initialValue) {
|
||||
});
|
||||
|
||||
const setValue = value => {
|
||||
console.log("SETTING VALUE", value);
|
||||
try {
|
||||
const valueToStore =
|
||||
value instanceof Function ? value(storedValue) : value;
|
||||
|
||||
Reference in New Issue
Block a user