diff --git a/.github/workflows/build-binaries.yml b/.github/workflows/build-binaries.yml index 1d39adeae..507e01178 100644 --- a/.github/workflows/build-binaries.yml +++ b/.github/workflows/build-binaries.yml @@ -25,7 +25,7 @@ concurrency: env: # we want to publish on "push to master" only. When we don't want to publish, we want to upload artefacts - SHOULD_PUBLISH: ${{ github.event_name == 'push' && github.ref == 'master' }} + SHOULD_PUBLISH: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} jobs: build_linux: @@ -77,7 +77,7 @@ jobs: # we want this to run only when on "push" to "master" if: ${{ env.SHOULD_PUBLISH == 'true' }} run: | - sed -i 's/\"target\": \\[\"deb\"\\]/\"target\": \"${{ matrix.pkg_to_build }}\"/g' package.json; yarn build-release-publish + sed -i 's/"target": \["deb"\]/"target": "${{ matrix.pkg_to_build }}"/g' package.json && yarn build-release-publish build_windows: runs-on: windows-2022 diff --git a/package.json b/package.json index 063968495..d5b0f2cd6 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "session-desktop", "productName": "Session", "description": "Private messaging from your desktop", - "version": "1.14.1", + "version": "1.14.2", "license": "GPL-3.0", "author": { "name": "Oxen Labs", diff --git a/ts/components/dialog/OpenUrlModal.tsx b/ts/components/dialog/OpenUrlModal.tsx index db5ff30f9..de729a32d 100644 --- a/ts/components/dialog/OpenUrlModal.tsx +++ b/ts/components/dialog/OpenUrlModal.tsx @@ -61,7 +61,6 @@ export function OpenUrlModal(props: OpenUrlModalState) { /> { const ourNumber = useSelector(getOurNumber); @@ -238,6 +240,19 @@ export const ActionsPanel = () => { return () => clearTimeout(timeout); }, []); + const globalUnreadMessageCount = useSelector(getGlobalUnreadMessageCount); + + // Reuse the unreadToShow from the global state to update the badge count + useThrottleFn( + (unreadCount: number) => { + if (globalUnreadMessageCount !== undefined) { + ipcRenderer.send('update-badge-count', unreadCount); + } + }, + 2000, + [globalUnreadMessageCount] + ); + useInterval(cleanUpOldDecryptedMedias, startCleanUpMedia ? cleanUpMediasInterval : null); useFetchLatestReleaseFromFileServer(); diff --git a/ts/mains/main_node.ts b/ts/mains/main_node.ts index 3de057251..cd4ba2a3f 100644 --- a/ts/mains/main_node.ts +++ b/ts/mains/main_node.ts @@ -10,6 +10,7 @@ import { dialog, protocol as electronProtocol, ipcMain as ipc, + ipcMain, IpcMainEvent, Menu, nativeTheme, @@ -27,7 +28,7 @@ import { platform as osPlatform } from 'process'; import url from 'url'; import Logger from 'bunyan'; -import _, { isEmpty } from 'lodash'; +import _, { isEmpty, isNumber, isFinite } from 'lodash'; import pify from 'pify'; import { setupGlobalErrorHandler } from '../node/global_errors'; // checked - only node @@ -1019,6 +1020,14 @@ ipc.on('get-start-in-tray', event => { } }); +ipcMain.on('update-badge-count', (_event, count) => { + if (app.isReady()) { + app.setBadgeCount( + isNumber(count) && isFinite(count) && count >= 0 ? count : 0 + ); + } +}); + ipc.on('get-opengroup-pruning', event => { try { const val = userConfig.get('opengroupPruning');