Skip to content

Commit

Permalink
Fixed a bug in lazy loading. Fixed #639.
Browse files Browse the repository at this point in the history
  • Loading branch information
ransome1 committed Feb 8, 2024
1 parent 8d63c9c commit 16d7b76
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion flatpak/com.github.ransome1.sleek.appdata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<developer_name>Robin Ahle</developer_name>
<content_rating type="oars-1.1"/>
<releases>
<release version="2.0.9-rc.2" date="2024-02-08"/>
<release version="2.0.9-rc.3" date="2024-02-08"/>
</releases>
<url type="homepage">https://github.com/ransome1/sleek</url>
<url type="contact">https://github.com/ransome1/sleek/issues</url>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sleek",
"version": "2.0.9-rc.2",
"version": "2.0.9-rc.3",
"main": "./src/main/main.tsx",
"scripts": {
"build": "concurrently \"yarn run peggy\" \"yarn run build:main\" \"yarn run build:renderer\"",
Expand Down
2 changes: 1 addition & 1 deletion release/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sleek",
"version": "2.0.9-rc.2",
"version": "2.0.9-rc.3",
"description": "todo.txt manager for Linux, Windows and MacOS, free and open-source (FOSS)",
"synopsis": "todo.txt manager for Linux, Windows and MacOS, free and open-source (FOSS)",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: sleek
base: core20
version: "2.0.9-rc.2"
version: "2.0.9-rc.3"
summary: todo.txt manager for Linux, free and open-source (FOSS)
description: |
sleek is an open-source (FOSS) todo manager based on the todo.txt syntax. Stripped down to only the most necessary features, and with a clean and simple interface, sleek aims to help you focus on getting things done.
Expand Down
3 changes: 3 additions & 0 deletions src/renderer/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ const App = () => {
}, [settings.language]);

useEffect(() => {
const windowHeight = window.innerHeight;
const calculatedRowCount = Math.floor(windowHeight / 35);
setVisibleRowCount(calculatedRowCount * 1.5);
ipcRenderer.send('requestData');
}, []);

Expand Down
1 change: 0 additions & 1 deletion src/renderer/Drawer/Attributes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
cursor: pointer;
}
.MuiBadge-badge {
width: 0.5em;
z-index: 10;
font-weight: bold;
font-size: 0.75em;
Expand Down
5 changes: 2 additions & 3 deletions src/renderer/Grid/Grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ const GridComponent: React.FC<GridComponentProps> = memo(({
}) => {

const list = document.getElementById('grid');
const totalRowCount = todoObjects?.length || 0;
const groups = new Array;
const visibleTodoObjects = todoObjects?.filter(todoObject => todoObject.visible !== false)?.slice(0, visibleRowCount);
const totalRowCount = todoObjects?.length || 0;

const handleButtonClick = (key: string, value: string) => {
handleFilterSelect(key, value, filters, false);
Expand Down Expand Up @@ -87,8 +88,6 @@ const GridComponent: React.FC<GridComponentProps> = memo(({
}
};

const visibleTodoObjects = todoObjects?.filter(todoObject => todoObject.visible !== false);

if(visibleTodoObjects.length === 0) return null;

return (
Expand Down
5 changes: 3 additions & 2 deletions src/renderer/Grid/Renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,10 @@ const RendererComponent = ({ todoObject, filters, settings, handleButtonClick })

modifiedChild = reactStringReplace(modifiedChild, pattern, (match, i) => {

const selected = filters && type !== null && (filters[type as keyof Filters] || []).some((filter: Filter) => filter.value === match);
const selected = filters && type !== null && (filters[type as keyof Filters] || []).some((filter: Filter) => filter.value === match);

return (
<span key={`${type}-${i}`} className={selected ? 'filter selected' : 'filter'} data-todotxt-attribute={type}>
<span className={selected ? 'filter selected' : 'filter'} data-todotxt-attribute={type}>
{replacements[type](match, type)}
</span>
);
Expand Down

0 comments on commit 16d7b76

Please sign in to comment.