()
| 301 | } |
| 302 | |
| 303 | async function startApp() |
| 304 | { |
| 305 | if(config.checkReleases) |
| 306 | checkReleases.check(); |
| 307 | |
| 308 | loadContextMenu(); |
| 309 | |
| 310 | handlebarsContext.indexHeaderTitle = language.global.library; |
| 311 | |
| 312 | template.loadContentRight('index.content.right.empty.html', false); |
| 313 | template.loadHeader('index.header.html', false); |
| 314 | template.loadGlobalElement('global.elements.menus.html', 'global-menus'); |
| 315 | template.loadGlobalElement('index.elements.menus.html', 'menus'); |
| 316 | dom.loadIndexContentLeft(false); |
| 317 | |
| 318 | if(!toOpenFile) |
| 319 | { |
| 320 | for(let i = 1, len = electronRemote.process.argv.length; i < len; i++) |
| 321 | { |
| 322 | const arg = electronRemote.process.argv[i]; |
| 323 | |
| 324 | if(arg && !['--no-sandbox', 'scripts/main.js', '.'].includes(arg) && !/^--/.test(arg) && !/app\.asar/i.test(arg) && fs.existsSync(arg)) |
| 325 | { |
| 326 | toOpenFile = arg; |
| 327 | break; |
| 328 | } |
| 329 | } |
| 330 | } |
| 331 | |
| 332 | if(toOpenFile && fs.existsSync(toOpenFile)) |
| 333 | { |
| 334 | openComic(toOpenFile, false); |
| 335 | } |
| 336 | else |
| 337 | { |
| 338 | let lastReading = false; |
| 339 | |
| 340 | if(config.startInContinueReading) |
| 341 | { |
| 342 | let readingProgress = relative.get('readingProgress'); |
| 343 | let highest = 0; |
| 344 | |
| 345 | for(let key in readingProgress) |
| 346 | { |
| 347 | if(readingProgress[key].lastReading > highest) |
| 348 | { |
| 349 | lastReading = { |
| 350 | mainPath: key, |
| 351 | path: readingProgress[key].path, |
| 352 | }; |
| 353 | |
| 354 | highest = readingProgress[key].lastReading; |
| 355 | } |
| 356 | } |
| 357 | |
| 358 | if(lastReading && config.startOnlyFromLibrary) |
| 359 | { |
| 360 | let mainPaths = {}; |
no test coverage detected