local storage clear set fix
This commit is contained in:
parent
d9e932ce8c
commit
dcbc288faf
@ -45,7 +45,7 @@ export function AuthProvider({ children }: { children: ReactNode }) {
|
||||
setUserEmail(null);
|
||||
setIsAdmin(false);
|
||||
setRoles([]);
|
||||
localStorage.removeItem('krishna_sales_user_email');
|
||||
localStorage.clear();
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@ -23,11 +23,11 @@ export function DailyLogsPage() {
|
||||
const mapComponent = (
|
||||
<div className="!bg-[var(--tiles-card-bg)] rounded-lg shadow-sm border border-gray-100 overflow-hidden flex flex-col h-full min-h-[320px]">
|
||||
<div className="px-5 py-4 border-b border-[var(--z-block-border)] flex items-center gap-2">
|
||||
<MapPin size={18} className="text-slate-400" />
|
||||
<h3 className="text-md font-semibold text-[var(--z-text-default)]">Activity Locations</h3>
|
||||
<MapPin size={18} className="text-slate-400" />
|
||||
<h3 className="text-md font-semibold text-[var(--z-text-default)]">Activity Locations</h3>
|
||||
</div>
|
||||
<div className="flex-1 relative bg-slate-50">
|
||||
<DailyLogMap />
|
||||
<DailyLogMap />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
@ -35,14 +35,14 @@ export function DailyLogsPage() {
|
||||
return (
|
||||
<>
|
||||
{instanceId == null && (
|
||||
<DailyLogsView
|
||||
<DailyLogsView
|
||||
mapComponent={mapComponent}
|
||||
refreshKey={refreshKey}
|
||||
presetAlias="my_logs"
|
||||
presetAlias=""
|
||||
onRowClick={(row) => {
|
||||
const id = row.instance_id as number | string | undefined;
|
||||
if (id != null) navigate(`/daily/${id}`);
|
||||
}}
|
||||
}}
|
||||
headerActions={
|
||||
<Button size="sm" iconLeft={<Plus size={14} />} onClick={() => {
|
||||
setCreateTitle('Punch In');
|
||||
@ -55,7 +55,7 @@ export function DailyLogsPage() {
|
||||
const state = String(row.current_state_name || row.current_state_name_ || row.current_state || row.status || '').toLowerCase();
|
||||
// Show only for Punched In, hide for Punched Out or others
|
||||
if (state.includes('out') || !state.includes('in')) return null;
|
||||
|
||||
|
||||
return (
|
||||
<Button size="sm" variant="secondary" onClick={() => {
|
||||
setPunchOutTitle('Punch Out');
|
||||
@ -74,8 +74,8 @@ export function DailyLogsPage() {
|
||||
title={createTitle}
|
||||
width="md"
|
||||
>
|
||||
<DynamicForm
|
||||
client={dailyReportsClient}
|
||||
<DynamicForm
|
||||
client={dailyReportsClient}
|
||||
activityId={DAILY_REPORTS.activities.INIT.uid}
|
||||
initialActivityName="Punch In"
|
||||
onSuccess={() => {
|
||||
@ -94,8 +94,8 @@ export function DailyLogsPage() {
|
||||
width="md"
|
||||
>
|
||||
{punchOutInstanceId != null && (
|
||||
<DynamicForm
|
||||
client={dailyReportsClient}
|
||||
<DynamicForm
|
||||
client={dailyReportsClient}
|
||||
activityId={DAILY_REPORTS.activities.PUNCH_OUT.uid}
|
||||
instanceId={punchOutInstanceId}
|
||||
initialActivityName="Punch Out"
|
||||
@ -111,11 +111,11 @@ export function DailyLogsPage() {
|
||||
|
||||
{instanceId != null && (
|
||||
<div className="w-full">
|
||||
<DailyLogDetail
|
||||
instanceId={instanceId}
|
||||
refreshKey={refreshKey}
|
||||
onPunchOut={() => setPunchOutInstanceId(instanceId)}
|
||||
onBack={() => navigate('/daily')}
|
||||
<DailyLogDetail
|
||||
instanceId={instanceId}
|
||||
refreshKey={refreshKey}
|
||||
onPunchOut={() => setPunchOutInstanceId(instanceId)}
|
||||
onBack={() => navigate('/daily')}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user