Merge pull request #4 from session-foundation/chore/no-ref/merge_master

Merge master back into unstable
pull/3257/head
Audric Ackermann 6 months ago committed by GitHub
commit 6254ec51f3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -25,7 +25,7 @@ concurrency:
env: env:
# we want to publish on "push to master" only. When we don't want to publish, we want to upload artefacts # 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: jobs:
build_linux: build_linux:
@ -77,7 +77,7 @@ jobs:
# we want this to run only when on "push" to "master" # we want this to run only when on "push" to "master"
if: ${{ env.SHOULD_PUBLISH == 'true' }} if: ${{ env.SHOULD_PUBLISH == 'true' }}
run: | 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: build_windows:
runs-on: windows-2022 runs-on: windows-2022

@ -2,7 +2,7 @@
"name": "session-desktop", "name": "session-desktop",
"productName": "Session", "productName": "Session",
"description": "Private messaging from your desktop", "description": "Private messaging from your desktop",
"version": "1.14.1", "version": "1.14.2",
"license": "GPL-3.0", "license": "GPL-3.0",
"author": { "author": {
"name": "Oxen Labs", "name": "Oxen Labs",

@ -61,7 +61,6 @@ export function OpenUrlModal(props: OpenUrlModalState) {
/> />
<SessionButton <SessionButton
text={window.i18n('urlCopy')} text={window.i18n('urlCopy')}
buttonColor={SessionButtonColor.White}
buttonType={SessionButtonType.Simple} buttonType={SessionButtonType.Simple}
onClick={onClickCopy} onClick={onClickCopy}
dataTestId="session-confirm-cancel-button" dataTestId="session-confirm-cancel-button"

@ -1,9 +1,11 @@
import { ipcRenderer } from 'electron';
import { debounce } from 'lodash'; import { debounce } from 'lodash';
import { useEffect, useRef, useState } from 'react'; import { useEffect, useRef, useState } from 'react';
import { useDispatch, useSelector } from 'react-redux'; import { useDispatch, useSelector } from 'react-redux';
import useInterval from 'react-use/lib/useInterval'; import useInterval from 'react-use/lib/useInterval';
import useTimeoutFn from 'react-use/lib/useTimeoutFn'; import useTimeoutFn from 'react-use/lib/useTimeoutFn';
import useThrottleFn from 'react-use/lib/useThrottleFn';
import { Data } from '../../data/data'; import { Data } from '../../data/data';
import { getConversationController } from '../../session/conversations'; import { getConversationController } from '../../session/conversations';
@ -37,18 +39,18 @@ import { LeftPaneSectionContainer } from './LeftPaneSectionContainer';
import { SettingsKey } from '../../data/settings-key'; import { SettingsKey } from '../../data/settings-key';
import { useFetchLatestReleaseFromFileServer } from '../../hooks/useFetchLatestReleaseFromFileServer'; import { useFetchLatestReleaseFromFileServer } from '../../hooks/useFetchLatestReleaseFromFileServer';
import { useHotkey } from '../../hooks/useHotkey';
import { import {
forceRefreshRandomSnodePool, forceRefreshRandomSnodePool,
getFreshSwarmFor, getFreshSwarmFor,
} from '../../session/apis/snode_api/snodePool'; } from '../../session/apis/snode_api/snodePool';
import { ConfigurationSync } from '../../session/utils/job_runners/jobs/ConfigurationSyncJob'; import { ConfigurationSync } from '../../session/utils/job_runners/jobs/ConfigurationSyncJob';
import { getIsModalVisble } from '../../state/selectors/modal';
import { useIsDarkTheme } from '../../state/selectors/theme'; import { useIsDarkTheme } from '../../state/selectors/theme';
import { switchThemeTo } from '../../themes/switchTheme'; import { switchThemeTo } from '../../themes/switchTheme';
import { ReleasedFeatures } from '../../util/releaseFeature'; import { ReleasedFeatures } from '../../util/releaseFeature';
import { getOppositeTheme } from '../../util/theme'; import { getOppositeTheme } from '../../util/theme';
import { SessionNotificationCount } from '../icon/SessionNotificationCount'; import { SessionNotificationCount } from '../icon/SessionNotificationCount';
import { useHotkey } from '../../hooks/useHotkey';
import { getIsModalVisble } from '../../state/selectors/modal';
const Section = (props: { type: SectionType }) => { const Section = (props: { type: SectionType }) => {
const ourNumber = useSelector(getOurNumber); const ourNumber = useSelector(getOurNumber);
@ -238,6 +240,19 @@ export const ActionsPanel = () => {
return () => clearTimeout(timeout); 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); useInterval(cleanUpOldDecryptedMedias, startCleanUpMedia ? cleanUpMediasInterval : null);
useFetchLatestReleaseFromFileServer(); useFetchLatestReleaseFromFileServer();

@ -10,6 +10,7 @@ import {
dialog, dialog,
protocol as electronProtocol, protocol as electronProtocol,
ipcMain as ipc, ipcMain as ipc,
ipcMain,
IpcMainEvent, IpcMainEvent,
Menu, Menu,
nativeTheme, nativeTheme,
@ -27,7 +28,7 @@ import { platform as osPlatform } from 'process';
import url from 'url'; import url from 'url';
import Logger from 'bunyan'; import Logger from 'bunyan';
import _, { isEmpty } from 'lodash'; import _, { isEmpty, isNumber, isFinite } from 'lodash';
import pify from 'pify'; import pify from 'pify';
import { setupGlobalErrorHandler } from '../node/global_errors'; // checked - only node 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 => { ipc.on('get-opengroup-pruning', event => {
try { try {
const val = userConfig.get('opengroupPruning'); const val = userConfig.get('opengroupPruning');

Loading…
Cancel
Save