Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
use normal setting instead of UIFeature
Browse files Browse the repository at this point in the history
Signed-off-by: Kerry Archibald <kerrya@element.io>
  • Loading branch information
Kerry Archibald committed Jan 27, 2022
1 parent 74ccf3d commit 6998302
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
5 changes: 2 additions & 3 deletions src/components/views/dialogs/ExportDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import Exporter from "../../../utils/exportUtils/Exporter";
import Spinner from "../elements/Spinner";
import InfoDialog from "./InfoDialog";
import SettingsStore from "../../../settings/SettingsStore";
import { UIFeature } from "../../../settings/UIFeature";

interface IProps extends IDialogProps {
room: Room;
Expand All @@ -61,7 +60,7 @@ export type ForceRoomExportParameters = {
format?: ExportFormat; range?: ExportType; numberOfMessages?: number; includeAttachments?: boolean; sizeMb?: number;
};
export const getSafeForceRoomExportParameters = (): ForceRoomExportParameters => {
const config = SettingsStore.getValue<ForceRoomExportParameters>(UIFeature.ForceRoomExportParameters);
const config = SettingsStore.getValue<ForceRoomExportParameters>("forceRoomExportParameters");
if (!config || typeof config !== "object") return {};

const { format, range, numberOfMessages, includeAttachments, sizeMb } = config;
Expand Down Expand Up @@ -90,7 +89,7 @@ interface ExportConfig {
}

/**
* Set up form state using UIFeature.ForceRoomExportParameters or defaults
* Set up form state using "forceRoomExportParameters" or defaults
* Form fields configured in ForceRoomExportParameters are not allowed to be edited
* Only return change handlers for editable values
*/
Expand Down
8 changes: 4 additions & 4 deletions src/settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,10 @@ export const SETTINGS: {[setting: string]: ISetting} = {
default: false,
controller: new ReloadOnChangeController(),
},
"forceRoomExportParameters": {

This comment has been minimized.

Copy link
@t3chguy

t3chguy Jan 27, 2022

Member

forcing stuff is normally handled by https://github.com/vector-im/element-web/blob/develop/docs/customisations.md rather than hidden settings (the latter of which can easily be side-stepped using your javascript console)

supportedLevels: LEVELS_UI_FEATURE,

This comment has been minimized.

Copy link
@t3chguy

t3chguy Jan 27, 2022

Member

this isn't right

default: {},
},
[UIFeature.RoomHistorySettings]: {
supportedLevels: LEVELS_UI_FEATURE,
default: true,
Expand Down Expand Up @@ -956,8 +960,4 @@ export const SETTINGS: {[setting: string]: ISetting} = {
supportedLevels: LEVELS_UI_FEATURE,
default: true,
},
[UIFeature.ForceRoomExportParameters]: {
supportedLevels: LEVELS_UI_FEATURE,
default: {},
},
};
1 change: 0 additions & 1 deletion src/settings/UIFeature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export enum UIFeature {
AdvancedSettings = "UIFeature.advancedSettings",
RoomHistorySettings = "UIFeature.roomHistorySettings",
TimelineEnableRelativeDates = "UIFeature.timelineEnableRelativeDates",
ForceRoomExportParameters = "UIFeature.ForceRoomExportParameters"
}

export enum UIComponent {
Expand Down

0 comments on commit 6998302

Please sign in to comment.