Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## 2026-09-27

### Fixed
- Logout cache cleaning. [PR 89](https://github.com/thermcampos/tasknote/pull/89)

---

## 2026-09-25

### Added
- Cache to Home to avoid fetching content when not neeedd. [PR 86](https://github.com/thermcampos/tasknote/pull/86)

### Changed
- Notes title and URLs moved to inside the note body. [Issue 83](https://github.com/thermcampos/tasknote/issues/83)
- Notes works with live MD renderer, similar to Notion. [PR 88](https://github.com/thermcampos/tasknote/pull/88)

```
# Docker images
- ghcr.io/thermcampos/tasknote/client:app-v2026.09.25.13
- ghcr.io/thermcampos/tasknote/client:app-v2026.09.25.16
```
---

Expand Down
3 changes: 2 additions & 1 deletion client/src/__test__/views/Home.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ vi.mock('../../utils/TranslatorUtils', () => ({
}));

vi.mock('react-router', () => ({
useLocation: () => ({ state: null }),
useLocation: () => ({ state: null, pathname: '/home' }),
useNavigate: () => vi.fn(),
NavLink: ({ to, children }: { to: string, children: React.ReactNode }) => (
<a href={to} data-testid={`navlink-${to}`}>{children}</a>
)
Expand Down
3 changes: 3 additions & 0 deletions client/src/context/AuthProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import api from '../api-service/api';
import ApiConfig from '../api-service/apiConfig';
import { UserResponse } from '../types/UserResponse';
import { UserRegistration } from '../types/UserRegistration';
import { clearHomeCache } from '../utils/HomeCache';

interface Props {
children: React.ReactNode;
Expand Down Expand Up @@ -111,6 +112,7 @@ const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ children }: Pro
localStorage.removeItem(API_TOKEN);
localStorage.removeItem(REDIRECT_PATH);
localStorage.removeItem(USER_DATA);
clearHomeCache();
};

useEffect(() => {
Expand All @@ -127,6 +129,7 @@ const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ children }: Pro
setSigned(false);
setUser(undefined);
localStorage.clear();
clearHomeCache();
});
}, TWENTY_FIVE_MINUTES);
return () => clearInterval(intervalId);
Expand Down
14 changes: 11 additions & 3 deletions client/src/views/Home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import FilterContext from '../../context/FilterContext';
import ContentHeader from '../../components/ContentHeader';
import AlertError from '../../components/AlertError';
import { CheckSquare, JournalText, ThreeDotsVertical } from 'react-bootstrap-icons';
import { NavLink, useLocation } from 'react-router';
import { NavLink, useLocation, useNavigate } from 'react-router';
import ModalMarkdown from '../../components/ModalMarkdown';
import TaskTitle from '../../components/TaskTitle';
import TaskTimeLeft from '../../components/TaskTimeLeft';
Expand Down Expand Up @@ -52,8 +52,10 @@ function Home(): React.ReactNode {
const { filterText, selectedOption, setFilterText, setSelectedOption } = useContext(FilterContext);
const { i18n, t } = useTranslation();
const location = useLocation();
const refreshAfterSave
= (location.state as { refreshHome?: boolean } | null)?.refreshHome === true;
const navigate = useNavigate();
const [refreshAfterSave] = useState(
() => (location.state as { refreshHome?: boolean } | null)?.refreshHome === true
);
const [errorMessage, setErrorMessage] = useState<string>('');
const [tags, setTags] = useState<string[]>([]);
const [name, setName] = useState<string>(user?.name ? user?.name : 'User');
Expand Down Expand Up @@ -463,6 +465,12 @@ function Home(): React.ReactNode {
setSelectedOption(value);
};

useEffect(() => {
if (refreshAfterSave) {
navigate(location.pathname, { replace: true, state: null });
}
}, [refreshAfterSave, navigate, location.pathname]);

useEffect(() => {
handleDefaultLang(user?.lang);
setName(user?.name ?? 'User');
Expand Down
Loading