diff --git a/package.json b/package.json index d7c438c7f..faf8d684a 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "session-desktop", "productName": "Session", "description": "Private messaging from your desktop", - "version": "1.7.6", + "version": "1.8.0", "license": "GPL-3.0", "author": { "name": "Loki Project", diff --git a/preload.js b/preload.js index 1044dabdf..115b2150a 100644 --- a/preload.js +++ b/preload.js @@ -38,7 +38,7 @@ window.isBehindProxy = () => Boolean(config.proxyUrl); window.lokiFeatureFlags = { useOnionRequests: true, useMessageRequests: false, - useCallMessage: false, + useCallMessage: true, }; window.isBeforeVersion = (toCheck, baseVersion) => { diff --git a/ts/components/leftpane/conversation-list-item/HeaderItem.tsx b/ts/components/leftpane/conversation-list-item/HeaderItem.tsx index 8589f9be0..c8e69fc72 100644 --- a/ts/components/leftpane/conversation-list-item/HeaderItem.tsx +++ b/ts/components/leftpane/conversation-list-item/HeaderItem.tsx @@ -11,7 +11,8 @@ import { ContextConversationId } from './ConversationListItem'; import { UserItem } from './UserItem'; const NotificationSettingIcon = (props: { isMessagesSection: boolean }) => { - const convoSetting = useSelector(useConversationPropsById)?.currentNotificationSetting; + const convoId = useContext(ContextConversationId); + const convoSetting = useConversationPropsById(convoId)?.currentNotificationSetting; if (!props.isMessagesSection) { return null; diff --git a/ts/components/menu/Menu.tsx b/ts/components/menu/Menu.tsx index da980d193..f148a6b5c 100644 --- a/ts/components/menu/Menu.tsx +++ b/ts/components/menu/Menu.tsx @@ -155,11 +155,11 @@ export const getPinConversationMenuItem = (conversationId: string): JSX.Element if (isMessagesSection) { const conversation = getConversationController().get(conversationId); - const isPinned = conversation.isPinned(); + const isPinned = conversation?.isPinned() || false; const togglePinConversation = async () => { if ((!isPinned && nbOfAlreadyPinnedConvos < maxNumberOfPinnedConversations) || isPinned) { - await conversation.setIsPinned(!isPinned); + await conversation?.setIsPinned(!isPinned); } else { ToastUtils.pushToastWarning( 'pinConversationLimitToast', diff --git a/ts/test-integration/sample.test.ts b/ts/test-integration/sample.test.ts deleted file mode 100644 index 8c4134d64..000000000 --- a/ts/test-integration/sample.test.ts +++ /dev/null @@ -1,80 +0,0 @@ -// tslint:disable: no-console -// tslint:disable no-implicit-dependencies -import { expect } from 'chai'; -import { _electron as electron, ElectronApplication, Page } from 'playwright'; - -const NODE_ENV = 'integration-test'; - -function throwIfNoFirstInstance( - instanceToCastIfValid: ElectronApplication | null, - pageToCastIfValid: Page | null -): { instance: ElectronApplication; page: Page } { - if (!instanceToCastIfValid) { - throw new Error('no instanceToCastIfValid'); - } - if (!pageToCastIfValid) { - throw new Error('no pageToCastIfValid'); - } - return { page: pageToCastIfValid, instance: instanceToCastIfValid }; -} - -async function createAppInstance(MULTI: number) { - // Launch Electron app. - process.env.NODE_ENV = NODE_ENV; - process.env.NODE_APP_INSTANCE = `${MULTI}`; - const instance = await electron.launch({ - args: ['main.js'], - }); - - // Get the first window that the app opens, wait if necessary. - const page = await instance.firstWindow(); - // page.on('console', console.log); - return { instance, page }; -} - -async function killAppInstance(appInstance?: ElectronApplication | null) { - // Kill Electron app. - if (appInstance) { - await appInstance.close(); - } - return null; -} - -describe('quick test', () => { - let firstAppInstance: ElectronApplication | null = null; - let firstAppPage: Page | null = null; - - beforeEach(async () => { - if (firstAppInstance) { - throw new Error('beforeAll cannot create first instance'); - } - const { instance, page } = await createAppInstance(1); - firstAppInstance = instance; - firstAppPage = page; - }); - - afterEach(async () => { - firstAppInstance = await killAppInstance(firstAppInstance); - }); - - it('check "Begin your Session" is shown on app start', async () => { - const { instance, page } = throwIfNoFirstInstance(firstAppInstance, firstAppPage); - // Evaluation expression in the Electron context. - const appPath = await instance.evaluate(async ({ app }) => { - // This runs in the main Electron process, parameter here is always - // the result of the require('electron') in the main app script. - return app.getAppPath(); - }); - console.log(appPath); - // Print the title.instance - const title = await page.title(); - - const beginSessionSelector = await page.waitForSelector( - 'div.session-content-accent-text.title' - ); - const contentBeginYourSession = await beginSessionSelector.innerHTML(); - expect(contentBeginYourSession).to.equal('Begin your Session.'); - - expect(title).to.eq('Session'); - }); -});