This commit is contained in:
David Arranz 2024-08-26 11:08:32 +02:00
parent cfb4b2b3bd
commit 6ff591d359
3 changed files with 11 additions and 3 deletions

View File

@ -11,7 +11,7 @@ import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from "@/ui";
import { CurrencyData, Language, Quantity } from "@shared/contexts";
import { ColumnDef } from "@tanstack/react-table";
import { t } from "i18next";
import { ChevronDownIcon, ChevronUpIcon, Trash2Icon } from "lucide-react";
import { ChevronDownIcon, ChevronUpIcon, CopyIcon, Trash2Icon } from "lucide-react";
import { useCallback, useState } from "react";
import { useFieldArray, useFormContext } from "react-hook-form";
import { useDetailColumns } from "../../hooks";
@ -158,11 +158,11 @@ export const QuoteDetailsCardEditor = ({
rowActionFn: (props) => {
const { table, row } = props;
return [
/*{
{
label: t("common.duplicate_row"),
icon: <CopyIcon className='w-4 h-4 mr-2' />,
onClick: () => table.options.meta?.duplicateItems(row.index),
},*/
},
{
label: t("common.insert_row_above"),
icon: <ChevronUpIcon className='w-4 h-4 mr-2' />,

View File

@ -24,6 +24,13 @@ export const ProtectedRoute = ({ children }: ProctectRouteProps) => {
}
if (isSuccess && !authenticated) {
// Redirect them to the /login page, but save the current location they were
// trying to go to when they were redirected. This allows us to send them
// along to that page after they login, which is a nicer user experience
// than dropping them off on the home page.
return <Navigate to={redirectTo ?? "/login"} state={{ from: location }} replace />;
console.log("No authenticated");
return (
<Navigate
to={redirectTo ?? "/login"}

View File

@ -18,6 +18,7 @@ export const useLogin = (params?: UseMutationOptions<AuthActionResponse, Error,
onSuccess: (data, variables, context) => {
const { success, redirectTo } = data;
if (success && redirectTo) {
console.log("redirect to /home");
navigate(redirectTo || "/home", { replace: false });
}
if (onSuccess) {