Commit 2ca6e9ae authored by ransome1's avatar ransome1
Browse files

Improved background refresh

parent 44a83a54
{ {
"name": "sleek", "name": "sleek",
"productName": "sleek", "productName": "sleek",
"version": "1.1.2-rc.3", "version": "1.1.2-rc.4",
"description": "Todo app based on todo.txt for Linux, Windows and MacOS, free and open-source", "description": "Todo app based on todo.txt for Linux, Windows and MacOS, free and open-source",
"synopsis": "Todo app based on todo.txt for Linux, Windows and MacOS, free and open-source", "synopsis": "Todo app based on todo.txt for Linux, Windows and MacOS, free and open-source",
"category": "ProjectManagement", "category": "ProjectManagement",
......
...@@ -781,7 +781,7 @@ const createWindow = async function() { ...@@ -781,7 +781,7 @@ const createWindow = async function() {
// REFRESH WHEN IN BACKGROUND // REFRESH WHEN IN BACKGROUND
// ######################################################################################################################## // ########################################################################################################################
setInterval(() => { setInterval(() => {
if(userData.data.files.length > 0 && !mainWindow.isFocused()) { if(userData.data.files && !mainWindow.isFocused()) {
const index = userData.data.files.findIndex(file => file[0] ===1 ); const index = userData.data.files.findIndex(file => file[0] ===1 );
getContent(userData.data.files[index][1]).then(content => { getContent(userData.data.files[index][1]).then(content => {
mainWindow.webContents.send("refresh", [content]) mainWindow.webContents.send("refresh", [content])
...@@ -789,7 +789,7 @@ const createWindow = async function() { ...@@ -789,7 +789,7 @@ const createWindow = async function() {
console.error(error); console.error(error);
}); });
} }
}, 600000); }, 60000);
} }
// ######################################################################################################################## // ########################################################################################################################
// APP EVENTS // APP EVENTS
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment