Skip to content

Commit

Permalink
Merge pull request #588 from BlueBubblesApp/development
Browse files Browse the repository at this point in the history
v1,9,1 pt 2
  • Loading branch information
zlshames authored Nov 10, 2023
2 parents 1f09b7f + 084c277 commit ae114da
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 23 deletions.
2 changes: 1 addition & 1 deletion packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"@babel/plugin-proposal-private-property-in-object": "^7.16.7",
"@babel/preset-env": "^7.12.11",
"@babel/preset-typescript": "^7.12.7",
"@electron/notarize": "^2.1.0",
"@types/better-sqlite3": "^7.5.0",
"@types/crypto-js": "^4.0.1",
"@types/electron": "^1.6.10",
Expand All @@ -62,7 +63,6 @@
"css-loader": "^3.5.2",
"electron": "17.4.11",
"electron-builder": "^23.0.2",
"electron-notarize": "^1.2.1",
"electron-rebuild": "^3.2.9",
"eslint": "^8.13.0",
"eslint-config-prettier": "^8.5.0",
Expand Down
5 changes: 3 additions & 2 deletions packages/server/scripts/notarize.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable consistent-return */
/* eslint-disable no-return-await */
require('dotenv').config();
const { notarize } = require('electron-notarize');
const { notarize } = require('@electron/notarize');

exports.default = async function notarizing(context) {
const { electronPlatformName, appOutDir } = context;
Expand All @@ -12,9 +12,10 @@ exports.default = async function notarizing(context) {
const appName = context.packager.appInfo.productFilename;

return await notarize({
appBundleId: 'com.bluebubbles.messaging',
tool: 'notarytool',
appPath: `${appOutDir}/${appName}.app`,
appleId: process.env.APPLEID,
appleIdPassword: process.env.APPLEIDPASS,
teamId: process.env.TEAMID
});
};
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,16 @@ export const DailyMessagesStatBox = (
delay?: number
}
): JSX.Element => {
const args = (): NodeJS.Dict<any> | null => {
const after = new Date();
after.setDate(after.getDate() - 1);
return { after };
};

return (
<UpdatableStatBox
title='Daily Messages'
statName="daily_messages"
ipcEvent="get-message-count"
color="yellow"
args={args}
autoUpdate={autoUpdate}
updateInterval={updateInterval}
delay={delay}
pastDays={0}
pastDays={1}
/>
);
};
7 changes: 3 additions & 4 deletions packages/ui/src/app/components/stats/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const UpdatableStatBox = (
autoUpdate = true,
updateInterval = 60000,
delay = 0,
pastDays = 0
pastDays = null
}:
{
title: string,
Expand All @@ -72,7 +72,7 @@ export const UpdatableStatBox = (
autoUpdate?: boolean,
updateInterval?: number,
delay?: number,
pastDays?: number
pastDays?: number | null
}
): JSX.Element => {
const dispatch = useAppDispatch();
Expand All @@ -90,10 +90,9 @@ export const UpdatableStatBox = (

// Fetch the stat and dispatch the results to listeners
let finalArgs = args ? args() : null;
if (pastDays) {
if (pastDays && pastDays > 0) {
if (!finalArgs) finalArgs = {};
finalArgs.after = new Date(new Date().getTime() - (pastDays * 86_400_000));
console.log(finalArgs);
}

ipcRenderer.invoke(ipcEvent, finalArgs).then(async (value) => {
Expand Down
17 changes: 9 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2190,6 +2190,15 @@
optionalDependencies:
global-agent "^3.0.0"

"@electron/notarize@^2.1.0":
version "2.1.0"
resolved "https://registry.yarnpkg.com/@electron/notarize/-/notarize-2.1.0.tgz#76aaec10c8687225e8d0a427cc9df67611c46ff3"
integrity sha512-Q02xem1D0sg4v437xHgmBLxI2iz/fc0D4K7fiVWHa/AnW8o7D751xyKNXgziA6HrTOme9ul1JfWN5ark8WH1xA==
dependencies:
debug "^4.1.1"
fs-extra "^9.0.1"
promise-retry "^2.0.1"

"@electron/universal@1.2.1":
version "1.2.1"
resolved "https://registry.yarnpkg.com/@electron/universal/-/universal-1.2.1.tgz#3c2c4ff37063a4e9ab1e6ff57db0bc619bc82339"
Expand Down Expand Up @@ -6705,14 +6714,6 @@ electron-log@^4.4.7:
resolved "https://registry.yarnpkg.com/electron-log/-/electron-log-4.4.8.tgz#fcb9f714dbcaefb6ac7984c4683912c74730248a"
integrity sha512-QQ4GvrXO+HkgqqEOYbi+DHL7hj5JM+nHi/j+qrN9zeeXVKy8ZABgbu4CnG+BBqDZ2+tbeq9tUC4DZfIWFU5AZA==

electron-notarize@^1.2.1:
version "1.2.2"
resolved "https://registry.yarnpkg.com/electron-notarize/-/electron-notarize-1.2.2.tgz#ebf2b258e8e08c1c9f8ff61dc53d5b16b439daf4"
integrity sha512-ZStVWYcWI7g87/PgjPJSIIhwQXOaw4/XeXU+pWqMMktSLHaGMLHdyPPN7Cmao7+Cr7fYufA16npdtMndYciHNw==
dependencies:
debug "^4.1.1"
fs-extra "^9.0.1"

electron-osx-sign@^0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/electron-osx-sign/-/electron-osx-sign-0.6.0.tgz#9b69c191d471d9458ef5b1e4fdd52baa059f1bb8"
Expand Down

0 comments on commit ae114da

Please sign in to comment.