.
This commit is contained in:
parent
cfb4b2b3bd
commit
6ff591d359
@ -11,7 +11,7 @@ import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from "@/ui";
|
|||||||
import { CurrencyData, Language, Quantity } from "@shared/contexts";
|
import { CurrencyData, Language, Quantity } from "@shared/contexts";
|
||||||
import { ColumnDef } from "@tanstack/react-table";
|
import { ColumnDef } from "@tanstack/react-table";
|
||||||
import { t } from "i18next";
|
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 { useCallback, useState } from "react";
|
||||||
import { useFieldArray, useFormContext } from "react-hook-form";
|
import { useFieldArray, useFormContext } from "react-hook-form";
|
||||||
import { useDetailColumns } from "../../hooks";
|
import { useDetailColumns } from "../../hooks";
|
||||||
@ -158,11 +158,11 @@ export const QuoteDetailsCardEditor = ({
|
|||||||
rowActionFn: (props) => {
|
rowActionFn: (props) => {
|
||||||
const { table, row } = props;
|
const { table, row } = props;
|
||||||
return [
|
return [
|
||||||
/*{
|
{
|
||||||
label: t("common.duplicate_row"),
|
label: t("common.duplicate_row"),
|
||||||
icon: <CopyIcon className='w-4 h-4 mr-2' />,
|
icon: <CopyIcon className='w-4 h-4 mr-2' />,
|
||||||
onClick: () => table.options.meta?.duplicateItems(row.index),
|
onClick: () => table.options.meta?.duplicateItems(row.index),
|
||||||
},*/
|
},
|
||||||
{
|
{
|
||||||
label: t("common.insert_row_above"),
|
label: t("common.insert_row_above"),
|
||||||
icon: <ChevronUpIcon className='w-4 h-4 mr-2' />,
|
icon: <ChevronUpIcon className='w-4 h-4 mr-2' />,
|
||||||
|
|||||||
@ -24,6 +24,13 @@ export const ProtectedRoute = ({ children }: ProctectRouteProps) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isSuccess && !authenticated) {
|
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 (
|
return (
|
||||||
<Navigate
|
<Navigate
|
||||||
to={redirectTo ?? "/login"}
|
to={redirectTo ?? "/login"}
|
||||||
|
|||||||
@ -18,6 +18,7 @@ export const useLogin = (params?: UseMutationOptions<AuthActionResponse, Error,
|
|||||||
onSuccess: (data, variables, context) => {
|
onSuccess: (data, variables, context) => {
|
||||||
const { success, redirectTo } = data;
|
const { success, redirectTo } = data;
|
||||||
if (success && redirectTo) {
|
if (success && redirectTo) {
|
||||||
|
console.log("redirect to /home");
|
||||||
navigate(redirectTo || "/home", { replace: false });
|
navigate(redirectTo || "/home", { replace: false });
|
||||||
}
|
}
|
||||||
if (onSuccess) {
|
if (onSuccess) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user