|
|
@ -1,4 +1,4 @@
|
|
|
|
import React, { useEffect, useState } from 'react';
|
|
|
|
import React, { Dispatch, useEffect, useState } from 'react';
|
|
|
|
import { SessionIconButton, SessionIconSize, SessionIconType } from './icon';
|
|
|
|
import { SessionIconButton, SessionIconSize, SessionIconType } from './icon';
|
|
|
|
import { Avatar, AvatarSize } from '../Avatar';
|
|
|
|
import { Avatar, AvatarSize } from '../Avatar';
|
|
|
|
import { darkTheme, lightTheme } from '../../state/ducks/SessionTheme';
|
|
|
|
import { darkTheme, lightTheme } from '../../state/ducks/SessionTheme';
|
|
|
@ -31,7 +31,7 @@ import { showLeftPaneSection } from '../../state/ducks/section';
|
|
|
|
|
|
|
|
|
|
|
|
import { cleanUpOldDecryptedMedias } from '../../session/crypto/DecryptedAttachmentsManager';
|
|
|
|
import { cleanUpOldDecryptedMedias } from '../../session/crypto/DecryptedAttachmentsManager';
|
|
|
|
import { OpenGroupManagerV2 } from '../../opengroup/opengroupV2/OpenGroupManagerV2';
|
|
|
|
import { OpenGroupManagerV2 } from '../../opengroup/opengroupV2/OpenGroupManagerV2';
|
|
|
|
import { loadDefaultRoomsIfNeeded } from '../../opengroup/opengroupV2/ApiUtil';
|
|
|
|
import { loadDefaultRooms } from '../../opengroup/opengroupV2/ApiUtil';
|
|
|
|
// tslint:disable-next-line: no-import-side-effect no-submodule-imports
|
|
|
|
// tslint:disable-next-line: no-import-side-effect no-submodule-imports
|
|
|
|
|
|
|
|
|
|
|
|
export enum SectionType {
|
|
|
|
export enum SectionType {
|
|
|
@ -131,18 +131,9 @@ const showResetSessionIDDialogIfNeeded = async () => {
|
|
|
|
const cleanUpMediasInterval = MINUTES * 30;
|
|
|
|
const cleanUpMediasInterval = MINUTES * 30;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* ActionsPanel is the far left banner (not the left pane).
|
|
|
|
* This function is called only once: on app startup with a logged in user
|
|
|
|
* The panel with buttons to switch between the message/contact/settings/theme views
|
|
|
|
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
export const ActionsPanel = () => {
|
|
|
|
const doAppStartUp = (dispatch: Dispatch<any>) => {
|
|
|
|
const dispatch = useDispatch();
|
|
|
|
|
|
|
|
const [startCleanUpMedia, setStartCleanUpMedia] = useState(false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const ourPrimaryConversation = useSelector(getOurPrimaryConversation);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// this maxi useEffect is called only once: when the component is mounted.
|
|
|
|
|
|
|
|
// For the action panel, it means this is called only one per app start/with a user loggedin
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
|
|
|
if (window.lokiFeatureFlags.useOnionRequests || window.lokiFeatureFlags.useFileOnionRequests) {
|
|
|
|
if (window.lokiFeatureFlags.useOnionRequests || window.lokiFeatureFlags.useFileOnionRequests) {
|
|
|
|
// Initialize paths for onion requests
|
|
|
|
// Initialize paths for onion requests
|
|
|
|
void OnionPaths.getInstance().buildNewOnionPaths();
|
|
|
|
void OnionPaths.getInstance().buildNewOnionPaths();
|
|
|
@ -179,7 +170,23 @@ export const ActionsPanel = () => {
|
|
|
|
void OpenGroupManagerV2.getInstance().startPolling();
|
|
|
|
void OpenGroupManagerV2.getInstance().startPolling();
|
|
|
|
void syncConfiguration();
|
|
|
|
void syncConfiguration();
|
|
|
|
|
|
|
|
|
|
|
|
void loadDefaultRoomsIfNeeded();
|
|
|
|
void loadDefaultRooms();
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* ActionsPanel is the far left banner (not the left pane).
|
|
|
|
|
|
|
|
* The panel with buttons to switch between the message/contact/settings/theme views
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
export const ActionsPanel = () => {
|
|
|
|
|
|
|
|
const dispatch = useDispatch();
|
|
|
|
|
|
|
|
const [startCleanUpMedia, setStartCleanUpMedia] = useState(false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const ourPrimaryConversation = useSelector(getOurPrimaryConversation);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// this maxi useEffect is called only once: when the component is mounted.
|
|
|
|
|
|
|
|
// For the action panel, it means this is called only one per app start/with a user loggedin
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
|
|
|
void doAppStartUp(dispatch);
|
|
|
|
}, []);
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
|
|
// wait for cleanUpMediasInterval and then start cleaning up medias
|
|
|
|
// wait for cleanUpMediasInterval and then start cleaning up medias
|
|
|
|