GitHub: Use Time.timestamp instead of Date.now

The timestamp is now Epoch Unix style (in seconds rather than ms)
This commit is contained in:
quadbyte 2025-08-12 14:26:00 -04:00
parent 0d196b2917
commit e3ff4e5bcf

View file

@ -57,13 +57,13 @@ Singleton {
// --------------------------------
function loadFromCache() {
const now = Date.now()
if (!data.timestamp || (now - data.timestamp > githubUpdateFrequency * 1000)) {
const now = Time.timestamp
if (!data.timestamp || (now >= data.timestamp + githubUpdateFrequency)) {
console.log("[GitHub] Cache expired or missing, fetching new data from GitHub...")
fetchFromGitHub()
return
}
console.log("[GitHub] Loading cached GitHub data (age:", Math.round((now - data.timestamp) / 60000),"minutes)")
console.log("[GitHub] Loading cached GitHub data (age:", Math.round((now - data.timestamp) / 60), "minutes)")
if (data.version) {
root.latestVersion = data.version
@ -87,7 +87,7 @@ Singleton {
// --------------------------------
function saveData() {
data.timestamp = Date.now()
data.timestamp = Time.timestamp
Qt.callLater(() => {
// Access the FileView's writeAdapter method
var fileView = root.children.find(child => child.objectName === "githubDataFileView")