diff --git a/.gitignore b/.gitignore index 46a53868b..4fb6b55c0 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ /public/.user.ini /storage/*.key /vendor +/build /tmp ._* .env diff --git a/nativefier.js b/nativefier.js new file mode 100644 index 000000000..ff535bda7 --- /dev/null +++ b/nativefier.js @@ -0,0 +1,25 @@ +const nativefier = require('nativefier').default; +const config = require('./package.json'); + +const options = { + name: config.name, + version: config.version, + targetUrl: 'http://127.0.0.1:2222', + arch: 'arm64', + out: './build', + icon: './resources/assets/statics/public/images/logo-app.png', + clearCache: false, + disableDevTools: false, + disableContextMenu: false, + fileDownloadOptions: { + saveAs: true, + }, +}; + +nativefier(options, function (error, appPath) { + if (error) { + console.error(error); + } else { + console.log('App has been nativefied to', appPath); + } +}); diff --git a/package.json b/package.json index 5736fe2d0..1e3ac279f 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,7 @@ { - "private": true, + "name": "DooTask", + "version": "0.0.2", + "description": "DooTask is task management system", "scripts": { "dev": "npm run development", "development": "mix", @@ -19,6 +21,7 @@ "laravel-mix": "^6.0.6", "lodash": "^4.17.19", "moment": "^2.29.1", + "nativefier": "^44.0.4", "node-sass": "^4.11.0", "postcss": "^8.1.14", "resolve-url-loader": "^4.0.0", diff --git a/resources/assets/js/store/actions.js b/resources/assets/js/store/actions.js index b7a084ed3..9095406cc 100644 --- a/resources/assets/js/store/actions.js +++ b/resources/assets/js/store/actions.js @@ -1412,7 +1412,9 @@ export default { // 更新对话列表 if (dialog) { // 新增未读数 - if (data.userid !== state.userId) dialog.unread++; + if (data.userid !== state.userId && state.dialogMsgs.findIndex(({id}) => id == data.id) === -1) { + dialog.unread++; + } // 移动到首位 dispatch("moveDialogTop", dialog_id); } diff --git a/resources/assets/statics/public/images/logo-app.icns b/resources/assets/statics/public/images/logo-app.icns new file mode 100644 index 000000000..c34d20448 Binary files /dev/null and b/resources/assets/statics/public/images/logo-app.icns differ diff --git a/resources/assets/statics/public/images/logo-app.png b/resources/assets/statics/public/images/logo-app.png new file mode 100644 index 000000000..ec53c95c8 Binary files /dev/null and b/resources/assets/statics/public/images/logo-app.png differ