Skip to content

Commit 1249c19

Browse files
committed
fix
1 parent 792e31f commit 1249c19

4 files changed

Lines changed: 38 additions & 11 deletions

File tree

src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function App() {
5656

5757
useEffect(() => {
5858
if (attemptedLogin) {
59-
handleLogin();
59+
handleLogin(false);
6060
setAttemptedLogin(false);
6161
}
6262
}, [attemptedLogin]);
@@ -178,7 +178,7 @@ function App() {
178178
) : (
179179
<LoginChoice
180180
onContinueAsUser={() => setAttemptedLogin(true)}
181-
onSignInAnother={() => setAttemptedLogin(true)}
181+
onSignInAnother={() => handleLogin(true)}
182182
/>
183183
)}
184184

src/components/tasks/TaskListCard.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,13 @@ import { ExpandLess, ExpandMore } from "@mui/icons-material";
1919
import {
2020
DndContext,
2121
closestCenter,
22-
KeyboardSensor,
2322
PointerSensor,
2423
useSensor,
2524
useSensors,
2625
DragEndEvent,
2726
} from "@dnd-kit/core";
2827
import {
2928
SortableContext,
30-
sortableKeyboardCoordinates,
3129
verticalListSortingStrategy,
3230
arrayMove,
3331
} from "@dnd-kit/sortable";
@@ -64,13 +62,10 @@ export default function TaskListCard({
6462
reorderTasksLocally,
6563
} = useTasks();
6664

67-
// Sensors for drag and drop
65+
// Sensors for drag and drop (pointer only - keyboard conflicts with text inputs)
6866
const sensors = useSensors(
6967
useSensor(PointerSensor, {
7068
activationConstraint: { distance: 8 },
71-
}),
72-
useSensor(KeyboardSensor, {
73-
coordinateGetter: sortableKeyboardCoordinates,
7469
})
7570
);
7671

src/components/tasks/TaskListItem.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,9 +476,13 @@ export default function TaskListItem({
476476
overflow: "hidden",
477477
textOverflow: "ellipsis",
478478
whiteSpace: "nowrap",
479+
transition: "all 0.2s ease",
479480
"&:hover": task.status !== "completed" ? {
480481
bgcolor: "action.hover",
481482
borderRadius: 0.5,
483+
whiteSpace: "normal",
484+
wordBreak: "break-word",
485+
overflow: "visible",
482486
} : {},
483487
}}
484488
>
@@ -495,6 +499,12 @@ export default function TaskListItem({
495499
textOverflow: "ellipsis",
496500
whiteSpace: "nowrap",
497501
cursor: "pointer",
502+
transition: "all 0.2s ease",
503+
"&:hover": {
504+
whiteSpace: "normal",
505+
wordBreak: "break-word",
506+
overflow: "visible",
507+
},
498508
}}
499509
>
500510
{task.notes}

src/helpers/auth.ts

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ export async function deleteAccessToken() {
182182
try {
183183
return await removeFile(STORAGE_PATHS.access_token, { dir: DEFAULT_DIRECTORY });
184184
} catch (error) {
185-
console.error("Error deleting access token:", error);
186-
throw new Error("Error deleting access token");
185+
// File might not exist, that's okay - fail silently
186+
console.debug("deleteAccessToken: file may not exist", error);
187187
}
188188
}
189189

@@ -206,10 +206,32 @@ export async function getUserProfileFromStorage() {
206206
}
207207
}
208208

209+
export async function deleteUserProfile() {
210+
try {
211+
return await removeFile(STORAGE_PATHS.user_profile, { dir: DEFAULT_DIRECTORY });
212+
} catch (error) {
213+
// File might not exist, that's okay - fail silently
214+
console.debug("deleteUserProfile: file may not exist", error);
215+
}
216+
}
217+
209218

210-
export async function handleLogin() {
219+
export async function handleLogin(forceNew: boolean = false) {
211220
setRecoil(authLoadingState, true)
212221
try {
222+
// If forcing new account, delete stored token first
223+
if (forceNew) {
224+
try {
225+
await deleteAccessToken();
226+
await deleteUserProfile();
227+
} catch {
228+
// Tokens might not exist, that's fine
229+
}
230+
pushNotification('Choose an account');
231+
await openAuthWindow();
232+
return;
233+
}
234+
213235
const storedAccessToken = await getAccessTokenFromStorage();
214236
if (storedAccessToken) {
215237
handleLoadFrom(storedAccessToken);

0 commit comments

Comments
 (0)