mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-20 20:59:16 +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 { Can } from "../Can";
|
||||||
import TicketsQueueSelect from "../TicketsQueueSelect";
|
import TicketsQueueSelect from "../TicketsQueueSelect";
|
||||||
import { Button } from "@material-ui/core";
|
import { Button } from "@material-ui/core";
|
||||||
import { useLocalStorage } from "../../hooks/useLocalStorage";
|
|
||||||
|
|
||||||
const useStyles = makeStyles(theme => ({
|
const useStyles = makeStyles(theme => ({
|
||||||
ticketsWrapper: {
|
ticketsWrapper: {
|
||||||
@@ -88,12 +87,11 @@ const TicketsManager = () => {
|
|||||||
const [tab, setTab] = useState("open");
|
const [tab, setTab] = useState("open");
|
||||||
const [newTicketModalOpen, setNewTicketModalOpen] = useState(false);
|
const [newTicketModalOpen, setNewTicketModalOpen] = useState(false);
|
||||||
const [showAllTickets, setShowAllTickets] = useState(false);
|
const [showAllTickets, setShowAllTickets] = useState(false);
|
||||||
const { user } = useContext(AuthContext);
|
|
||||||
const searchInputRef = useRef();
|
const searchInputRef = useRef();
|
||||||
const [selectedQueueIds, setSelectedQueueIds] = useLocalStorage(
|
const { user } = useContext(AuthContext);
|
||||||
"selectedQueueIds",
|
|
||||||
[]
|
const userQueueIds = user.queues.map(q => q.id);
|
||||||
);
|
const [selectedQueueIds, setSelectedQueueIds] = useState(userQueueIds || []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (tab === "search") {
|
if (tab === "search") {
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ export function useLocalStorage(key, initialValue) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const setValue = value => {
|
const setValue = value => {
|
||||||
|
console.log("SETTING VALUE", value);
|
||||||
try {
|
try {
|
||||||
const valueToStore =
|
const valueToStore =
|
||||||
value instanceof Function ? value(storedValue) : value;
|
value instanceof Function ? value(storedValue) : value;
|
||||||
|
|||||||
Reference in New Issue
Block a user