small code cleanup and added components/ folder for reusable code
This commit is contained in:
@@ -31,6 +31,7 @@ PanelWindow {
|
||||
property bool _keyboardNav: false
|
||||
property var allItems: []
|
||||
property bool loading: false
|
||||
property int lastCacheUpdate: 0
|
||||
|
||||
|
||||
readonly property int defaultIndex: Cfg.Config.launcherSelectFirst ? 0 : -1
|
||||
@@ -67,7 +68,14 @@ PanelWindow {
|
||||
|
||||
function loadItems() {
|
||||
loading = true
|
||||
var now = Date.now()
|
||||
var staleMs = 300000
|
||||
if (now - lastCacheUpdate < staleMs) {
|
||||
readCache()
|
||||
return
|
||||
}
|
||||
readCache()
|
||||
lastCacheUpdate = now
|
||||
updateProc.command = [Cfg.Config.launcherScript, "--update-only"]
|
||||
updateProc.running = true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user