Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update fuselage #2673

Merged
merged 18 commits into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@
"@emotion/css": "^11.7.1",
"@emotion/react": "^11.7.1",
"@emotion/styled": "^11.6.0",
"@rocket.chat/css-in-js": "^0.31.23-dev.165",
"@rocket.chat/fuselage": "^0.32.0-dev.391",
"@rocket.chat/fuselage-hooks": "^0.32.0-dev.304",
"@rocket.chat/fuselage-polyfills": "^0.31.23-dev.165",
"@rocket.chat/icons": "^0.32.0-dev.373",
"@ewsjs/xhr": "^1.5.0",
"@rocket.chat/css-in-js": "^0.31.1",
"@rocket.chat/fuselage": "^0.31.1",
"@rocket.chat/fuselage-hooks": "^0.31.1",
"@rocket.chat/fuselage-polyfills": "^0.31.14",
"@rocket.chat/icons": "^0.31.1",
"abort-controller": "^3.0.0",
"axios": "^1.4.0",
"electron-dl": "^3.5.0",
Expand All @@ -73,7 +73,7 @@
"react-keyed-flatten-children": "^1.3.0",
"react-redux": "^7.2.6",
"redux": "^4.1.2",
"reselect": "^4.1.5",
"reselect": "4.1.6",
"rimraf": "^3.0.2",
"semver": "^7.3.5",
"tslib": "^2.3.1"
Expand All @@ -89,8 +89,8 @@
"@fiahfy/ico-convert": "^0.0.12",
"@jest-runner/electron": "^3.0.1",
"@rocket.chat/eslint-config": "^0.4.0",
"@rocket.chat/eslint-config-alt": "^0.31.1",
"@rocket.chat/prettier-config": "^0.31.1",
"@rocket.chat/eslint-config-alt": "^0.32.0-dev.143",
"@rocket.chat/prettier-config": "^0.31.23-dev.165",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "^21.0.1",
"@rollup/plugin-json": "^4.1.0",
Expand All @@ -112,7 +112,7 @@
"chokidar": "^3.5.3",
"conventional-changelog-cli": "^2.2.2",
"convert-svg-to-png": "^0.5.0",
"electron": "^22.3.1",
"electron": "24.4.0",
"electron-builder": "^23.6.0",
"electron-devtools-installer": "^3.2.0",
"electron-notarize": "^1.2.2",
Expand Down
6 changes: 3 additions & 3 deletions src/app/PersistableValues.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Certificate } from 'electron';

import { Download } from '../downloads/common';
import { Server } from '../servers/common';
import { WindowState } from '../ui/common';
import type { Download } from '../downloads/common';
import type { Server } from '../servers/common';
import type { WindowState } from '../ui/common';

type PersistableValues_0_0_0 = {
currentServerUrl: string;
Expand Down
2 changes: 1 addition & 1 deletion src/app/actions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PersistableValues } from './PersistableValues';
import type { PersistableValues } from './PersistableValues';

export const APP_ERROR_THROWN = 'app/error-thrown';
export const APP_PATH_SET = 'app/path-set';
Expand Down
3 changes: 2 additions & 1 deletion src/app/main/dev.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import fs from 'fs';
import path from 'path';

import { app, WebContents } from 'electron';
import type { WebContents } from 'electron';
import { app } from 'electron';

export const setUserDataDirectory = (): void => {
if (process.env.NODE_ENV !== 'development' || process.mas) {
Expand Down
3 changes: 2 additions & 1 deletion src/app/main/persistence.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { app } from 'electron';
import ElectronStore from 'electron-store';

import { PersistableValues, migrations } from '../PersistableValues';
import type { PersistableValues } from '../PersistableValues';
import { migrations } from '../PersistableValues';

let electronStore: ElectronStore<PersistableValues>;

Expand Down
4 changes: 2 additions & 2 deletions src/app/reducers/appPath.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Reducer } from 'redux';
import type { Reducer } from 'redux';

import { ActionOf } from '../../store/actions';
import type { ActionOf } from '../../store/actions';
import { APP_PATH_SET } from '../actions';

type AppPathAction = ActionOf<typeof APP_PATH_SET>;
Expand Down
4 changes: 2 additions & 2 deletions src/app/reducers/appVersion.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Reducer } from 'redux';
import type { Reducer } from 'redux';

import { ActionOf } from '../../store/actions';
import type { ActionOf } from '../../store/actions';
import { APP_VERSION_SET } from '../actions';

type AppVersionAction = ActionOf<typeof APP_VERSION_SET>;
Expand Down
4 changes: 2 additions & 2 deletions src/app/selectors.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createStructuredSelector } from 'reselect';

import { RootState } from '../store/rootReducer';
import { PersistableValues } from './PersistableValues';
import type { RootState } from '../store/rootReducer';
import type { PersistableValues } from './PersistableValues';

export const selectPersistableValues = createStructuredSelector<
RootState,
Expand Down
2 changes: 1 addition & 1 deletion src/buildAssets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { createElement } from 'react';
import { renderToStaticMarkup } from 'react-dom/server';
import rimraf from 'rimraf';

import { Server } from './servers/common';
import type { Server } from './servers/common';
import DmgBackground from './ui/assets/DmgBackground';
import NsisSideBar from './ui/assets/NsisSideBar';
import AppIcon from './ui/icons/AppIcon';
Expand Down
2 changes: 1 addition & 1 deletion src/deepLinks/actions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Server } from '../servers/common';
import type { Server } from '../servers/common';

export const DEEP_LINKS_SERVER_ADDED = 'deep-links/server-added';
export const DEEP_LINKS_SERVER_FOCUSED = 'deep-links/server-focused';
Expand Down
3 changes: 2 additions & 1 deletion src/deepLinks/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { URL } from 'url';

import { app, WebContents } from 'electron';
import type { WebContents } from 'electron';
import { app } from 'electron';

import {
electronBuilderJsonInformation,
Expand Down
2 changes: 1 addition & 1 deletion src/downloads/actions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Download } from './common';
import type { Download } from './common';

export const DOWNLOAD_CREATED = 'downloads/created';
export const DOWNLOAD_REMOVED = 'dowloads/removed';
Expand Down
4 changes: 2 additions & 2 deletions src/downloads/common.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Server } from '../servers/common';
import type { Server } from '../servers/common';

export const DownloadStatus = {
ALL: 'All',
Expand All @@ -15,7 +15,7 @@ export type Download = {
| 'cancelled'
| 'interrupted'
| 'expired';
status: typeof DownloadStatus[keyof typeof DownloadStatus];
status: (typeof DownloadStatus)[keyof typeof DownloadStatus];
fileName: string;
receivedBytes: number;
totalBytes: number;
Expand Down
22 changes: 11 additions & 11 deletions src/downloads/main.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import {
clipboard,
DownloadItem,
Event,
shell,
WebContents,
webContents,
} from 'electron';
import type { DownloadItem, Event, WebContents } from 'electron';
import { clipboard, shell, webContents } from 'electron';
import { t } from 'i18next';

import { handle } from '../ipc/main';
Expand All @@ -16,7 +10,8 @@ import {
DOWNLOAD_REMOVED,
DOWNLOAD_UPDATED,
} from './actions';
import { Download, DownloadStatus } from './common';
import type { Download } from './common';
import { DownloadStatus } from './common';

const items = new Map<Download['itemId'], DownloadItem>();

Expand Down Expand Up @@ -221,8 +216,13 @@ export const setupDownloads = (): void => {
payload: itemId,
});

if (webContentsId) {
webContents.fromId(webContentsId).downloadURL(download.url);
if (webContentsId && webContents !== undefined) {
if (webContents.fromId !== undefined) {
const webContentsInstance = webContents.fromId(webContentsId);
if (webContentsInstance !== undefined) {
webContentsInstance.downloadURL(download.url);
}
}
}
});

Expand Down
5 changes: 3 additions & 2 deletions src/downloads/reducers/downloads.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { APP_SETTINGS_LOADED } from '../../app/actions';
import { ActionOf } from '../../store/actions';
import type { ActionOf } from '../../store/actions';
import {
DOWNLOADS_CLEARED,
DOWNLOAD_CREATED,
DOWNLOAD_REMOVED,
DOWNLOAD_UPDATED,
} from '../actions';
import { Download, DownloadStatus } from '../common';
import type { Download } from '../common';
import { DownloadStatus } from '../common';

type DownloadsAction =
| ActionOf<typeof APP_SETTINGS_LOADED>
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/actions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import resources from './resources';
import type resources from './resources';

export const I18N_LNG_REQUESTED = 'i18n/lng-requested';
export const I18N_LNG_RESPONDED = 'i18n/lng-responded';
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/common.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { InitOptions } from 'i18next';
import type { InitOptions } from 'i18next';

export const fallbackLng = 'en' as const;

Expand Down
3 changes: 2 additions & 1 deletion src/i18n/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { app } from 'electron';
import i18next, { TFunction } from 'i18next';
import type { TFunction } from 'i18next';
import i18next from 'i18next';

import { dispatch, Service } from '../store';
import { hasMeta } from '../store/fsa';
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/resources.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Resource } from 'i18next';
import type { Resource } from 'i18next';

export default {
'de-DE': (): Promise<Resource> => import('./de-DE.i18n.json'),
Expand Down
2 changes: 1 addition & 1 deletion src/injected.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RocketChatDesktopAPI } from './servers/preload/api';
import type { RocketChatDesktopAPI } from './servers/preload/api';

declare global {
interface Window {
Expand Down
10 changes: 5 additions & 5 deletions src/ipc/channels.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { AnyAction } from 'redux';
import type { AnyAction } from 'redux';

import { Download } from '../downloads/common';
import { OutlookEventsResponse } from '../outlookCalendar/type';
import { Server } from '../servers/common';
import { SystemIdleState } from '../userPresence/common';
import type { Download } from '../downloads/common';
import type { OutlookEventsResponse } from '../outlookCalendar/type';
import type { Server } from '../servers/common';
import type { SystemIdleState } from '../userPresence/common';

type ChannelToArgsMap = {
'redux/get-initial-state': () => unknown;
Expand Down
5 changes: 3 additions & 2 deletions src/ipc/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ipcMain, WebContents } from 'electron';
import type { WebContents } from 'electron';
import { ipcMain } from 'electron';

import { Handler, Channel } from './channels';
import type { Handler, Channel } from './channels';

export const invoke = <N extends Channel>(
webContents: WebContents,
Expand Down
5 changes: 3 additions & 2 deletions src/ipc/renderer.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ipcRenderer, IpcRendererEvent } from 'electron';
import type { IpcRendererEvent } from 'electron';
import { ipcRenderer } from 'electron';

import { Handler, Channel } from './channels';
import type { Handler, Channel } from './channels';

export const handle = <N extends Channel>(
channel: N,
Expand Down
4 changes: 2 additions & 2 deletions src/jitsi/preload.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {
import type {
SourcesOptions,
DesktopCapturerSource,
NativeImage,
ipcRenderer,
DesktopCapturer,
} from 'electron';
import { ipcRenderer } from 'electron';

const jitsiDomain = window.location.origin;

Expand Down
4 changes: 2 additions & 2 deletions src/jitsi/reducers.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Reducer } from 'redux';
import type { Reducer } from 'redux';

import { APP_SETTINGS_LOADED } from '../app/actions';
import { ActionOf } from '../store/actions';
import type { ActionOf } from '../store/actions';
import {
JITSI_SERVER_CAPTURE_SCREEN_PERMISSIONS_CLEARED,
JITSI_SERVER_CAPTURE_SCREEN_PERMISSION_UPDATED,
Expand Down
4 changes: 2 additions & 2 deletions src/navigation/actions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Certificate } from 'electron';
import type { Certificate } from 'electron';

import { Server } from '../servers/common';
import type { Server } from '../servers/common';

export const CERTIFICATES_CLEARED = 'certificates/cleared';
export const CERTIFICATES_LOADED = 'certificates/loaded';
Expand Down
3 changes: 2 additions & 1 deletion src/navigation/main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import fs from 'fs';
import path from 'path';

import { app, Certificate } from 'electron';
import type { Certificate } from 'electron';
import { app } from 'electron';
import i18next from 'i18next';

import { request, select, dispatch } from '../store';
Expand Down
8 changes: 4 additions & 4 deletions src/navigation/reducers.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Certificate } from 'electron';
import { Reducer } from 'redux';
import type { Certificate } from 'electron';
import type { Reducer } from 'redux';

import { APP_SETTINGS_LOADED } from '../app/actions';
import { Server } from '../servers/common';
import { ActionOf } from '../store/actions';
import type { Server } from '../servers/common';
import type { ActionOf } from '../store/actions';
import {
CERTIFICATES_CLIENT_CERTIFICATE_REQUESTED,
SELECT_CLIENT_CERTIFICATE_DIALOG_CERTIFICATE_SELECTED,
Expand Down
2 changes: 1 addition & 1 deletion src/notifications/actions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ExtendedNotificationOptions } from './common';
import type { ExtendedNotificationOptions } from './common';

export const NOTIFICATIONS_CREATE_REQUESTED = 'notifications/create-requested';
export const NOTIFICATIONS_CREATE_RESPONDED = 'notifications/create-responded';
Expand Down
7 changes: 4 additions & 3 deletions src/notifications/main.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { Notification, nativeImage, NativeImage } from 'electron';
import type { NativeImage } from 'electron';
import { Notification, nativeImage } from 'electron';

import { invoke } from '../ipc/main';
import { dispatch, dispatchSingle, listen } from '../store';
import { ActionIPCMeta } from '../store/actions';
import type { ActionIPCMeta } from '../store/actions';
import { hasMeta } from '../store/fsa';
import { getRootWindow } from '../ui/main/rootWindow';
import {
Expand All @@ -15,7 +16,7 @@ import {
NOTIFICATIONS_NOTIFICATION_ACTIONED,
NOTIFICATIONS_NOTIFICATION_DISMISSED,
} from './actions';
import { ExtendedNotificationOptions } from './common';
import type { ExtendedNotificationOptions } from './common';

const resolveIcon = async (
iconUrl: string | undefined
Expand Down
4 changes: 2 additions & 2 deletions src/outlookCalendar/actions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Server } from '../servers/common';
import { OutlookCredentials } from './type';
import type { Server } from '../servers/common';
import type { OutlookCredentials } from './type';

export const OUTLOOK_CALENDAR_SET_CREDENTIALS =
'outlook-calendar/set-credentials';
Expand Down
2 changes: 1 addition & 1 deletion src/outlookCalendar/getOutlookEvents.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* eslint-disable new-cap */
import { XhrApi } from '@ewsjs/xhr';
import type { Appointment } from 'ews-javascript-api';
import {
FolderId,
CalendarView,
DateTime,
WellKnownFolderName,
Appointment,
BasePropertySet,
PropertySet,
ConfigurationApi,
Expand Down
2 changes: 1 addition & 1 deletion src/outlookCalendar/ipc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { safeStorage } from 'electron';

import { selectPersistableValues } from '../app/selectors';
import { handle } from '../ipc/main';
import { Server } from '../servers/common';
import type { Server } from '../servers/common';
import { dispatch, request, select } from '../store';
import {
OUTLOOK_CALENDAR_SET_CREDENTIALS,
Expand Down
Loading
Loading