cleanup actionPanel

pull/1576/head
Audric Ackermann 3 years ago
parent 75cc39e9e7
commit 9bf3cb1880
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -5,8 +5,16 @@
"contentProxyUrl": "",
"seedNodeList": [
{
"url": "http://public.loki.foundation:38157/",
"ip_url": "http://144.76.164.202:38157/"
"ip_url": "http://116.203.53.213:4433/",
"url": "https://storage.seed1.loki.network:4433/"
},
{
"ip_url": "http://212.199.114.66:4433/",
"url": "https://storage.seed3.loki.network:4433/"
},
{
"ip_url": "http://144.76.164.202:4433/",
"url": "https://public.loki.foundation:4433/"
}
],
"updatesEnabled": false,

@ -49,9 +49,7 @@ window.getServerTrustRoot = () => config.serverTrustRoot;
window.JobQueue = JobQueue;
window.isBehindProxy = () => Boolean(config.proxyUrl);
// FIXME audric
window.getStoragePubKey = key =>
window.isDev() ? key.substring(0, key.length - 2) : key.substring(0, key.length - 2);
window.getStoragePubKey = key => (window.isDev() ? key.substring(0, key.length - 2) : key);
window.getDefaultFileServer = () => config.defaultFileServer;
window.initialisedAPI = false;

@ -130,6 +130,23 @@ const showResetSessionIDDialogIfNeeded = async () => {
const cleanUpMediasInterval = MINUTES * 30;
const setupTheme = (dispatch: Dispatch<any>) => {
const theme = window.Events.getThemeSetting();
window.setTheme(theme);
const newThemeObject = theme === 'dark' ? darkTheme : lightTheme;
dispatch(applyTheme(newThemeObject));
};
// Do this only if we created a new Session ID, or if we already received the initial configuration message
const triggerSyncIfIfNeeded = async () => {
const didWeHandleAConfigurationMessageAlready =
(await getItemById(hasSyncedInitialConfigurationItem))?.value || false;
if (didWeHandleAConfigurationMessageAlready) {
await syncConfigurationIfNeeded();
}
};
/**
* This function is called only once: on app startup with a logged in user
*/
@ -139,36 +156,23 @@ const doAppStartUp = (dispatch: Dispatch<any>) => {
void OnionPaths.getInstance().buildNewOnionPaths();
}
// init the messageQueue. In the constructor, we had all not send messages
// init the messageQueue. In the constructor, we add all not send messages
// this call does nothing except calling the constructor, which will continue sending message in the pipeline
void getMessageQueue().processAllPending();
void setupTheme(dispatch);
const theme = window.Events.getThemeSetting();
window.setTheme(theme);
const newThemeObject = theme === 'dark' ? darkTheme : lightTheme;
dispatch(applyTheme(newThemeObject));
// keep that one to make sure our users upgrade to new sessionIDS
void showResetSessionIDDialogIfNeeded();
// remove existing prekeys, sign prekeys and sessions
// FIXME audric, make this in a migration so we can remove this line
void clearSessionsAndPreKeys();
// we consider people had the time to upgrade, so remove this id from the db
// it was used to display a dialog when we added the light mode auto-enabled
void removeItemById('hasSeenLightModeDialog');
// Do this only if we created a new Session ID, or if we already received the initial configuration message
const syncConfiguration = async () => {
const didWeHandleAConfigurationMessageAlready =
(await getItemById(hasSyncedInitialConfigurationItem))?.value || false;
if (didWeHandleAConfigurationMessageAlready) {
await syncConfigurationIfNeeded();
}
};
// this generates the key to encrypt attachments locally
void generateAttachmentKeyIfEmpty();
// trigger a sync message if needed for our other devices
void OpenGroupManagerV2.getInstance().startPolling();
void syncConfiguration();
// trigger a sync message if needed for our other devices
void triggerSyncIfIfNeeded();
void loadDefaultRooms();
};

@ -146,7 +146,6 @@ const loadDefaultRoomsSingle = () =>
* This call will only run once at a time.
*/
export const loadDefaultRooms = async () => {
// FIXME audric do the UI and refresh this list from time to time
const allRooms: Array<OpenGroupV2InfoJoinable> = await loadDefaultRoomsSingle();
if (allRooms !== undefined) {
window.inboxStore?.dispatch(updateDefaultRooms(allRooms));

Loading…
Cancel
Save