chore: bump version to 1.3.2
This commit is contained in:
@@ -60,18 +60,37 @@ const initBackend = () => {
|
||||
};
|
||||
// --- System Tray ---
|
||||
const createTray = () => {
|
||||
const assetsDir = path_1.default.join(__dirname, '..', 'assets-build');
|
||||
const possibleIcons = ['icon.svg', 'icon.png'];
|
||||
let iconPath = '';
|
||||
for (const name of possibleIcons) {
|
||||
const fullPath = path_1.default.join(assetsDir, name);
|
||||
if (fs_1.default.existsSync(fullPath)) {
|
||||
iconPath = fullPath;
|
||||
// Try to find the icon in various standard locations
|
||||
const possiblePaths = [
|
||||
path_1.default.join(__dirname, '..', 'assets-build'), // Dev
|
||||
path_1.default.join(process.resourcesPath, 'assets-build'), // Packaged (External)
|
||||
path_1.default.join(electron_1.app.getAppPath(), 'dist', 'assets-build'), // Packaged (Internal dist)
|
||||
path_1.default.join(electron_1.app.getAppPath(), 'assets-build') // Packaged (Internal root)
|
||||
];
|
||||
let assetsDir = '';
|
||||
for (const p of possiblePaths) {
|
||||
if (fs_1.default.existsSync(p)) {
|
||||
assetsDir = p;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!iconPath)
|
||||
const possibleIcons = ['icon.png', 'icon.svg'];
|
||||
let iconPath = '';
|
||||
if (assetsDir) {
|
||||
for (const name of possibleIcons) {
|
||||
const fullPath = path_1.default.join(assetsDir, name);
|
||||
if (fs_1.default.existsSync(fullPath)) {
|
||||
iconPath = fullPath;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log(`[Tray] Resolved assets directory: ${assetsDir || 'NOT FOUND'}`);
|
||||
console.log(`[Tray] Attempting to initialize with icon: ${iconPath || 'NONE FOUND'}`);
|
||||
if (!iconPath) {
|
||||
console.warn(`[Tray] FAILED: No valid icon found in searched paths.`);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const icon = electron_1.nativeImage.createFromPath(iconPath).resize({ width: 16, height: 16 });
|
||||
tray = new electron_1.Tray(icon);
|
||||
@@ -169,12 +188,12 @@ const scrapeAccountData = async (account) => {
|
||||
if (result.isActive) {
|
||||
account.cooldownExpiresAt = result.expiresAt ? result.expiresAt.toISOString() : new Date(Date.now() + 86400000).toISOString();
|
||||
if (backend)
|
||||
await backend.pushCooldown(account.steamId, account.cooldownExpiresAt);
|
||||
await backend.pushCooldown(account.steamId, account.cooldownExpiresAt, now.toISOString());
|
||||
}
|
||||
else {
|
||||
account.cooldownExpiresAt = undefined;
|
||||
if (backend)
|
||||
await backend.pushCooldown(account.steamId, undefined);
|
||||
await backend.pushCooldown(account.steamId, undefined, now.toISOString());
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
@@ -231,8 +250,24 @@ const syncAccounts = async (isManual = false) => {
|
||||
exists.sessionUpdatedAt = s.sessionUpdatedAt;
|
||||
hasChanges = true;
|
||||
}
|
||||
if (s.cooldownExpiresAt && (!exists.cooldownExpiresAt || new Date(s.cooldownExpiresAt) > new Date(exists.cooldownExpiresAt))) {
|
||||
// Metadata Sync (Pull)
|
||||
const sMetaDate = s.lastMetadataCheck ? new Date(s.lastMetadataCheck) : new Date(0);
|
||||
const lMetaDate = exists.lastBanCheck ? new Date(exists.lastBanCheck) : new Date(0);
|
||||
if (sMetaDate > lMetaDate) {
|
||||
exists.personaName = s.personaName;
|
||||
exists.avatar = s.avatar;
|
||||
exists.vacBanned = s.vacBanned;
|
||||
exists.gameBans = s.gameBans;
|
||||
exists.status = (s.vacBanned || s.gameBans > 0) ? 'banned' : 'none';
|
||||
exists.lastBanCheck = s.lastMetadataCheck;
|
||||
hasChanges = true;
|
||||
}
|
||||
// Cooldown Sync (Pull)
|
||||
const sScrapeDate = s.lastScrapeTime ? new Date(s.lastScrapeTime) : new Date(0);
|
||||
const lScrapeDate = exists.lastScrapeTime ? new Date(exists.lastScrapeTime) : new Date(0);
|
||||
if (sScrapeDate > lScrapeDate) {
|
||||
exists.cooldownExpiresAt = s.cooldownExpiresAt;
|
||||
exists.lastScrapeTime = s.lastScrapeTime;
|
||||
hasChanges = true;
|
||||
}
|
||||
if (JSON.stringify(exists.sharedWith) !== JSON.stringify(s.sharedWith)) {
|
||||
|
||||
Reference in New Issue
Block a user