2023-04-20 21:23:19 +00:00
|
|
|
// Copyright 2023 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
import ReactDOM from 'react-dom';
|
|
|
|
|
|
|
|
import type { PropsPreloadType } from '../../components/Preferences';
|
|
|
|
import { i18n } from '../sandboxedInit';
|
|
|
|
import { Preferences } from '../../components/Preferences';
|
|
|
|
import { startInteractionMode } from '../../services/InteractionMode';
|
|
|
|
import { strictAssert } from '../../util/assert';
|
2024-04-16 20:13:02 +00:00
|
|
|
import { parseEnvironment, setEnvironment } from '../../environment';
|
2023-04-20 21:23:19 +00:00
|
|
|
|
|
|
|
const { SettingsWindowProps } = window.Signal;
|
|
|
|
|
|
|
|
strictAssert(SettingsWindowProps, 'window values not provided');
|
|
|
|
|
|
|
|
startInteractionMode();
|
|
|
|
|
2024-04-16 20:13:02 +00:00
|
|
|
setEnvironment(
|
|
|
|
parseEnvironment(window.SignalContext.getEnvironment()),
|
|
|
|
window.SignalContext.isTestOrMockEnvironment()
|
|
|
|
);
|
|
|
|
|
2023-04-20 21:23:19 +00:00
|
|
|
SettingsWindowProps.onRender(
|
|
|
|
({
|
|
|
|
addCustomColor,
|
|
|
|
availableCameras,
|
2023-11-06 21:19:23 +00:00
|
|
|
availableLocales,
|
2023-04-20 21:23:19 +00:00
|
|
|
availableMicrophones,
|
|
|
|
availableSpeakers,
|
|
|
|
blockedCount,
|
|
|
|
closeSettings,
|
|
|
|
customColors,
|
|
|
|
defaultConversationColor,
|
|
|
|
deviceName,
|
2024-02-06 18:35:59 +00:00
|
|
|
phoneNumber,
|
2023-04-20 21:23:19 +00:00
|
|
|
doDeleteAllData,
|
|
|
|
doneRendering,
|
|
|
|
editCustomColor,
|
|
|
|
getConversationsWithCustomColor,
|
|
|
|
hasAudioNotifications,
|
2023-12-18 23:22:46 +00:00
|
|
|
hasAutoConvertEmoji,
|
2023-04-20 21:23:19 +00:00
|
|
|
hasAutoDownloadUpdate,
|
|
|
|
hasAutoLaunch,
|
|
|
|
hasCallNotifications,
|
|
|
|
hasCallRingtoneNotification,
|
|
|
|
hasCountMutedConversations,
|
|
|
|
hasHideMenuBar,
|
|
|
|
hasIncomingCallNotifications,
|
|
|
|
hasLinkPreviews,
|
|
|
|
hasMediaCameraPermissions,
|
|
|
|
hasMediaPermissions,
|
2023-05-08 19:59:36 +00:00
|
|
|
hasMessageAudio,
|
2023-04-20 21:23:19 +00:00
|
|
|
hasMinimizeToAndStartInSystemTray,
|
|
|
|
hasMinimizeToSystemTray,
|
|
|
|
hasNotificationAttention,
|
|
|
|
hasNotifications,
|
|
|
|
hasReadReceipts,
|
|
|
|
hasRelayCalls,
|
|
|
|
hasSpellCheck,
|
|
|
|
hasStoriesDisabled,
|
|
|
|
hasTextFormatting,
|
|
|
|
hasTypingIndicators,
|
|
|
|
initialSpellCheckSetting,
|
|
|
|
isAutoDownloadUpdatesSupported,
|
|
|
|
isAutoLaunchSupported,
|
|
|
|
isHideMenuBarSupported,
|
|
|
|
isMinimizeToAndStartInSystemTraySupported,
|
|
|
|
isNotificationAttentionSupported,
|
|
|
|
isSyncSupported,
|
|
|
|
isSystemTraySupported,
|
|
|
|
lastSyncTime,
|
|
|
|
makeSyncRequest,
|
|
|
|
notificationContent,
|
|
|
|
onAudioNotificationsChange,
|
2023-12-18 23:22:46 +00:00
|
|
|
onAutoConvertEmojiChange,
|
2023-04-20 21:23:19 +00:00
|
|
|
onAutoDownloadUpdateChange,
|
|
|
|
onAutoLaunchChange,
|
|
|
|
onCallNotificationsChange,
|
|
|
|
onCallRingtoneNotificationChange,
|
|
|
|
onCountMutedConversationsChange,
|
|
|
|
onHasStoriesDisabledChanged,
|
|
|
|
onHideMenuBarChange,
|
|
|
|
onIncomingCallNotificationsChange,
|
|
|
|
onLastSyncTimeChange,
|
2023-11-06 21:19:23 +00:00
|
|
|
onLocaleChange,
|
2023-04-20 21:23:19 +00:00
|
|
|
onMediaCameraPermissionsChange,
|
|
|
|
onMediaPermissionsChange,
|
2023-05-08 19:59:36 +00:00
|
|
|
onMessageAudioChange,
|
2023-04-20 21:23:19 +00:00
|
|
|
onMinimizeToAndStartInSystemTrayChange,
|
|
|
|
onMinimizeToSystemTrayChange,
|
|
|
|
onNotificationAttentionChange,
|
|
|
|
onNotificationContentChange,
|
|
|
|
onNotificationsChange,
|
|
|
|
onRelayCallsChange,
|
|
|
|
onSelectedCameraChange,
|
|
|
|
onSelectedMicrophoneChange,
|
|
|
|
onSelectedSpeakerChange,
|
|
|
|
onSentMediaQualityChange,
|
|
|
|
onSpellCheckChange,
|
|
|
|
onTextFormattingChange,
|
|
|
|
onThemeChange,
|
|
|
|
onUniversalExpireTimerChange,
|
|
|
|
onWhoCanFindMeChange,
|
|
|
|
onWhoCanSeeMeChange,
|
|
|
|
onZoomFactorChange,
|
2023-11-06 21:19:23 +00:00
|
|
|
preferredSystemLocales,
|
2023-04-20 21:23:19 +00:00
|
|
|
removeCustomColor,
|
|
|
|
removeCustomColorOnConversations,
|
|
|
|
resetAllChatColors,
|
|
|
|
resetDefaultChatColor,
|
2023-11-06 21:19:23 +00:00
|
|
|
resolvedLocale,
|
2023-04-20 21:23:19 +00:00
|
|
|
selectedCamera,
|
|
|
|
selectedMicrophone,
|
|
|
|
selectedSpeaker,
|
|
|
|
sentMediaQualitySetting,
|
|
|
|
setGlobalDefaultConversationColor,
|
2023-11-06 21:19:23 +00:00
|
|
|
localeOverride,
|
2023-04-20 21:23:19 +00:00
|
|
|
themeSetting,
|
|
|
|
universalExpireTimer,
|
|
|
|
whoCanFindMe,
|
|
|
|
whoCanSeeMe,
|
|
|
|
zoomFactor,
|
|
|
|
}: PropsPreloadType) => {
|
|
|
|
ReactDOM.render(
|
|
|
|
<Preferences
|
|
|
|
addCustomColor={addCustomColor}
|
|
|
|
availableCameras={availableCameras}
|
2023-11-06 21:19:23 +00:00
|
|
|
availableLocales={availableLocales}
|
2023-04-20 21:23:19 +00:00
|
|
|
availableMicrophones={availableMicrophones}
|
|
|
|
availableSpeakers={availableSpeakers}
|
|
|
|
blockedCount={blockedCount}
|
|
|
|
closeSettings={closeSettings}
|
|
|
|
customColors={customColors}
|
|
|
|
defaultConversationColor={defaultConversationColor}
|
|
|
|
deviceName={deviceName}
|
2024-02-06 18:35:59 +00:00
|
|
|
phoneNumber={phoneNumber}
|
2023-04-20 21:23:19 +00:00
|
|
|
doDeleteAllData={doDeleteAllData}
|
|
|
|
doneRendering={doneRendering}
|
|
|
|
editCustomColor={editCustomColor}
|
|
|
|
getConversationsWithCustomColor={getConversationsWithCustomColor}
|
|
|
|
hasAudioNotifications={hasAudioNotifications}
|
2023-12-18 23:22:46 +00:00
|
|
|
hasAutoConvertEmoji={hasAutoConvertEmoji}
|
2023-04-20 21:23:19 +00:00
|
|
|
hasAutoDownloadUpdate={hasAutoDownloadUpdate}
|
|
|
|
hasAutoLaunch={hasAutoLaunch}
|
|
|
|
hasCallNotifications={hasCallNotifications}
|
|
|
|
hasCallRingtoneNotification={hasCallRingtoneNotification}
|
|
|
|
hasCountMutedConversations={hasCountMutedConversations}
|
|
|
|
hasHideMenuBar={hasHideMenuBar}
|
|
|
|
hasIncomingCallNotifications={hasIncomingCallNotifications}
|
|
|
|
hasLinkPreviews={hasLinkPreviews}
|
|
|
|
hasMediaCameraPermissions={hasMediaCameraPermissions}
|
|
|
|
hasMediaPermissions={hasMediaPermissions}
|
2023-05-08 19:59:36 +00:00
|
|
|
hasMessageAudio={hasMessageAudio}
|
2023-04-20 21:23:19 +00:00
|
|
|
hasMinimizeToAndStartInSystemTray={hasMinimizeToAndStartInSystemTray}
|
|
|
|
hasMinimizeToSystemTray={hasMinimizeToSystemTray}
|
|
|
|
hasNotificationAttention={hasNotificationAttention}
|
|
|
|
hasNotifications={hasNotifications}
|
|
|
|
hasReadReceipts={hasReadReceipts}
|
|
|
|
hasRelayCalls={hasRelayCalls}
|
|
|
|
hasSpellCheck={hasSpellCheck}
|
|
|
|
hasStoriesDisabled={hasStoriesDisabled}
|
|
|
|
hasTextFormatting={hasTextFormatting}
|
|
|
|
hasTypingIndicators={hasTypingIndicators}
|
|
|
|
i18n={i18n}
|
|
|
|
initialSpellCheckSetting={initialSpellCheckSetting}
|
|
|
|
isAutoDownloadUpdatesSupported={isAutoDownloadUpdatesSupported}
|
|
|
|
isAutoLaunchSupported={isAutoLaunchSupported}
|
|
|
|
isHideMenuBarSupported={isHideMenuBarSupported}
|
|
|
|
isMinimizeToAndStartInSystemTraySupported={
|
|
|
|
isMinimizeToAndStartInSystemTraySupported
|
|
|
|
}
|
|
|
|
isNotificationAttentionSupported={isNotificationAttentionSupported}
|
|
|
|
isSyncSupported={isSyncSupported}
|
|
|
|
isSystemTraySupported={isSystemTraySupported}
|
|
|
|
lastSyncTime={lastSyncTime}
|
2023-11-06 21:19:23 +00:00
|
|
|
localeOverride={localeOverride}
|
2023-04-20 21:23:19 +00:00
|
|
|
makeSyncRequest={makeSyncRequest}
|
|
|
|
notificationContent={notificationContent}
|
|
|
|
onAudioNotificationsChange={onAudioNotificationsChange}
|
2023-12-18 23:22:46 +00:00
|
|
|
onAutoConvertEmojiChange={onAutoConvertEmojiChange}
|
2023-04-20 21:23:19 +00:00
|
|
|
onAutoDownloadUpdateChange={onAutoDownloadUpdateChange}
|
|
|
|
onAutoLaunchChange={onAutoLaunchChange}
|
|
|
|
onCallNotificationsChange={onCallNotificationsChange}
|
|
|
|
onCallRingtoneNotificationChange={onCallRingtoneNotificationChange}
|
|
|
|
onCountMutedConversationsChange={onCountMutedConversationsChange}
|
|
|
|
onHasStoriesDisabledChanged={onHasStoriesDisabledChanged}
|
|
|
|
onHideMenuBarChange={onHideMenuBarChange}
|
|
|
|
onIncomingCallNotificationsChange={onIncomingCallNotificationsChange}
|
|
|
|
onLastSyncTimeChange={onLastSyncTimeChange}
|
2023-11-06 21:19:23 +00:00
|
|
|
onLocaleChange={onLocaleChange}
|
2023-04-20 21:23:19 +00:00
|
|
|
onMediaCameraPermissionsChange={onMediaCameraPermissionsChange}
|
|
|
|
onMediaPermissionsChange={onMediaPermissionsChange}
|
2023-05-08 19:59:36 +00:00
|
|
|
onMessageAudioChange={onMessageAudioChange}
|
2023-04-20 21:23:19 +00:00
|
|
|
onMinimizeToAndStartInSystemTrayChange={
|
|
|
|
onMinimizeToAndStartInSystemTrayChange
|
|
|
|
}
|
|
|
|
onMinimizeToSystemTrayChange={onMinimizeToSystemTrayChange}
|
|
|
|
onNotificationAttentionChange={onNotificationAttentionChange}
|
|
|
|
onNotificationContentChange={onNotificationContentChange}
|
|
|
|
onNotificationsChange={onNotificationsChange}
|
|
|
|
onRelayCallsChange={onRelayCallsChange}
|
|
|
|
onSelectedCameraChange={onSelectedCameraChange}
|
|
|
|
onSelectedMicrophoneChange={onSelectedMicrophoneChange}
|
|
|
|
onSelectedSpeakerChange={onSelectedSpeakerChange}
|
|
|
|
onSentMediaQualityChange={onSentMediaQualityChange}
|
|
|
|
onSpellCheckChange={onSpellCheckChange}
|
|
|
|
onTextFormattingChange={onTextFormattingChange}
|
|
|
|
onThemeChange={onThemeChange}
|
|
|
|
onUniversalExpireTimerChange={onUniversalExpireTimerChange}
|
|
|
|
onWhoCanFindMeChange={onWhoCanFindMeChange}
|
|
|
|
onWhoCanSeeMeChange={onWhoCanSeeMeChange}
|
|
|
|
onZoomFactorChange={onZoomFactorChange}
|
2023-11-06 21:19:23 +00:00
|
|
|
preferredSystemLocales={preferredSystemLocales}
|
2023-04-20 21:23:19 +00:00
|
|
|
removeCustomColorOnConversations={removeCustomColorOnConversations}
|
|
|
|
removeCustomColor={removeCustomColor}
|
|
|
|
resetAllChatColors={resetAllChatColors}
|
|
|
|
resetDefaultChatColor={resetDefaultChatColor}
|
2023-11-06 21:19:23 +00:00
|
|
|
resolvedLocale={resolvedLocale}
|
2023-04-20 21:23:19 +00:00
|
|
|
selectedCamera={selectedCamera}
|
|
|
|
selectedMicrophone={selectedMicrophone}
|
|
|
|
selectedSpeaker={selectedSpeaker}
|
|
|
|
sentMediaQualitySetting={sentMediaQualitySetting}
|
|
|
|
setGlobalDefaultConversationColor={setGlobalDefaultConversationColor}
|
|
|
|
themeSetting={themeSetting}
|
|
|
|
universalExpireTimer={universalExpireTimer}
|
|
|
|
whoCanFindMe={whoCanFindMe}
|
|
|
|
whoCanSeeMe={whoCanSeeMe}
|
|
|
|
zoomFactor={zoomFactor}
|
|
|
|
/>,
|
|
|
|
document.getElementById('app')
|
|
|
|
);
|
|
|
|
}
|
|
|
|
);
|