Skip to content

Commit

Permalink
update to 1.23.3
Browse files Browse the repository at this point in the history
hooray!
  • Loading branch information
RoderickQiu committed Nov 6, 2021
1 parent f1296d3 commit e1440a3
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 628 deletions.
53 changes: 0 additions & 53 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ let i18n = require("i18n");
let Registry = require('winreg');
const windowsRelease = require('windows-release');
let cmdOrCtrl = require('cmd-or-ctrl');
let AV = require('leancloud-storage');
const { TouchBarLabel, TouchBarButton, TouchBarSpacer } = TouchBar;
const notifier = require('node-notifier')
const fetch = require('node-fetch');
Expand All @@ -26,7 +25,6 @@ let win = null, settingsWin = null, aboutWin = null, tourWin = null, floatingWin
pushNotificationLink = null,
workTimeFocused = false, restTimeFocused = false,
fullScreenProtection = false,
leanId = null, leanKey = null,
progress = -1, timeLeftOnBar = null,
dockHide = false,
newWindows = [], displays = null, hasMultiDisplays = null,
Expand Down Expand Up @@ -326,8 +324,6 @@ app.on('will-quit', () => {
//when created the app, triggers
//some apis can be only used inside ready
app.on('ready', () => {
require('dotenv').config({ path: path.join(__dirname, '.env') });

require('@electron/remote/main').initialize();

createWindow();
Expand Down Expand Up @@ -605,10 +601,6 @@ app.on('ready', () => {
}
})
}//backport when shadow disabled

leanId = process.env.LEAN_ID ? process.env.LEAN_ID : null;
leanKey = process.env.LEAN_KEY ? process.env.LEAN_KEY : null;
if (process.env.NODE_ENV !== "development") leanCloudSolution();
})

function hotkeyInit() {
Expand Down Expand Up @@ -1082,51 +1074,6 @@ ipcMain.on("settings-win-context-menu", function (event, message) {
}
})

function leanCloudSolution() {
if (leanId != null && leanKey != null)
try {
AV.init({
appId: leanId,
appKey: leanKey
});

let pushNotifications = new AV.Query('notifications');
pushNotifications.descending('createdAt');
pushNotifications.limit(3);

pushNotifications.find().then(function (notifications) {
notifications.forEach(function (notification) {
let targetVersion = notification.get('targetVersion').replace("v", "");
if (targetVersion == null || targetVersion === "" || targetVersion === require("./package.json").version.toString()) {
let content = (store.get("i18n").indexOf("zh") !== -1) ? notification.get('notificationContentChinese') : notification.get('notificationContentEnglish');
let title = (store.get("i18n").indexOf("zh") !== -1) ? notification.get('notificationTitleChinese') : notification.get('notificationTitleEnglish');
let link = (store.get("i18n").indexOf("zh") !== -1) ? notification.get('notificationLinkChinese') : notification.get('notificationLinkEnglish');
let id = notification.get('objectId');
if (!store.get(id) && win != null) {
pushNotificationLink = link;
store.set(id, true);
dialog.showMessageBox(win, {
title: " wnr",
type: "warning",
message: title,
detail: content,
buttons: [i18n.__('cancel'), i18n.__('ok')],
cancelId: 0
}).then(function (response) {
if (response.response !== 0)
if (pushNotificationLink !== "" && pushNotificationLink != null)
shell.openExternal(pushNotificationLink);
});
}
}
})
})
} catch (e) {
console.log(e);
}
else console.log("No LeanCloud key provided, skipped.")
}

function isDarkMode() {
if (app.isReady()) {
if (store.has("dark-or-white")) {
Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wnr",
"version": "1.23.2",
"version": "1.23.3",
"description": "Work and rest, with wnr now!",
"main": "main.js",
"scripts": {
Expand Down Expand Up @@ -35,12 +35,10 @@
"compare-version": "^0.1.2",
"copy-to-clipboard": "^3.3.1",
"crypto-js": "^4.1.1",
"dotenv": "^10.0.0",
"electron-debug": "^3.2.0",
"electron-store": "^8.0.1",
"i18n": "^0.13.3",
"jquery": "^3.6.0",
"leancloud-storage": "^4.11.1",
"node-fetch": "^2.6.6",
"node-notifier": "^10.0.0",
"node-shi": "^0.4.2",
Expand Down
17 changes: 10 additions & 7 deletions update.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
{
"version": "1.23.2",
"version": "1.23.3",
"feature-introduction": false,
"content": {
"zh-CN": [
"修复了禁止取消、跳过计时功能造成的 BUG。",
"优化了标题提醒窗口、统计和 MINI 模式。"
"测试提供 Linux 版本,使用 AppImage 封裝,感谢 @NKID00 参与。注意,它仍然存在一些 BUG。",
"修复了当 wnr 不位于主显示器时,不能正常覆盖所有显示器的问题。",
"修复了一些和 UI 相关的 BUG,如修复了有时计时界面按钮错位的问题,并优化了一些交互。"
],
"zh-TW": [
"修復了禁止取消、跳過計時功能造成的 BUG。",
"優化了標題提醒窗口、統計和 MINI 模式。"
"測試提供 Linux 版本,使用 AppImage 封裝,感謝 @NKID00 參與。注意,它仍然存在一些 BUG。",
"修復了當 wnr 不位於主顯示器時,不能正常覆蓋所有顯示器的問題。",
"修復了一些和 UI 相關的 BUG,如修復了有時計時界面按鈕錯位的問題,並優化了一些交互。"
],
"en": [
"Fixed some bugs related to the disable pause / back feature. ",
"Optimized external title window, statistics and mini mode. "
"Start to provide Linux package in .AppImage (BETA), thanks to @NKID00.",
"Fixed multi-screen bug that it didn't work when wnr is not on the primary screen. ",
"Enhanced UI and some other things."
]
},
"introduce": {
Expand Down
2 changes: 0 additions & 2 deletions updater.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ const compareVersion = require('compare-version');

let manuallyCheckText = '';

require('dotenv').config({ path: path.join(__dirname, '.env') });

function updateChecker(method) {
if (method === 2) {
manuallyCheckText = document.getElementById("manually").innerHTML;
Expand Down
Loading

1 comment on commit e1440a3

@RoderickQiu
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also deleted leancloud-storage and dotenv, as they are no longer needed.

Please sign in to comment.