Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ if (process.platform === 'win32') {

let notificationsEnabled = true;
let checkForUpdates = true;
let ignoredVersion = '';
let mainWindow;
let currentLang = 'zh-TW'; // Default language

Expand All @@ -34,6 +35,9 @@ function loadConfig() {
if (config.checkForUpdates !== undefined) {
checkForUpdates = config.checkForUpdates;
}
if (config.ignoredVersion) {
ignoredVersion = config.ignoredVersion;
}
}
} catch (e) {
console.error('Failed to load config:', e);
Expand All @@ -42,7 +46,7 @@ function loadConfig() {

function saveConfig() {
try {
const config = { language: currentLang, checkForUpdates };
const config = { language: currentLang, checkForUpdates, ignoredVersion };
fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
} catch (e) {
console.error('Failed to save config:', e);
Expand Down Expand Up @@ -96,6 +100,9 @@ if (!gotTheLock) {
if (!response.ok) return;
const data = await response.json();
const latestVersion = data.tag_name.replace(/^v/, '');

if (!manual && latestVersion === ignoredVersion) return;

const currentVersion = app.getVersion();

// Split by dot or hyphen to handle 1.0.7-20251223 vs 1.0.7
Expand All @@ -121,13 +128,16 @@ if (!gotTheLock) {
type: 'info',
title: t('updateAvailable'),
message: t('updateMessage').replace('{version}', latestVersion),
buttons: [t('download'), t('later')],
buttons: [t('download'), t('later'), t('ignoreUpdate')],
defaultId: 0,
cancelId: 1
});

if (btnIndex === 0) {
shell.openExternal(data.html_url);
} else if (btnIndex === 2) {
ignoredVersion = latestVersion;
saveConfig();
}
} else if (manual) {
const focusedWin = BrowserWindow.getFocusedWindow();
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fbm",
"version": "1.2.2",
"version": "1.3.0",
"description": "Facebook Messenger desktop app",
"main": "main.js",
"scripts": {
Expand Down
2 changes: 2 additions & 0 deletions translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ module.exports = {
updateMessage: 'A new version {version} is available. Do you want to download it now?',
download: 'Download',
later: 'Later',
ignoreUpdate: 'Ignore this version',
loadFailedTitle: 'Messenger Load Failed',
loadFailedMessage: 'Please check your internet connection or click the button below to retry.'
},
Expand Down Expand Up @@ -82,6 +83,7 @@ module.exports = {
updateMessage: '發現新版本 {version}。您想要現在下載嗎?',
download: '下載',
later: '稍後',
ignoreUpdate: '忽略此次更新',
loadFailedTitle: 'Messenger 載入失敗',
loadFailedMessage: '請檢查您的網路連線,或點擊下方按鈕重新嘗試。'
}
Expand Down