Skip to content

Commit 9fb8db1

Browse files
committed
inverse logic(hide->show)
1 parent 028e318 commit 9fb8db1

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/components/views/dialogs/devtools/RoomState.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ const RoomStateExplorerEventType: React.FC<IEventTypeProps> = ({ eventType, onBa
115115
const [query, setQuery] = useState("");
116116
const [event, setEvent] = useState<MatrixEvent | null>(null);
117117
const [history, setHistory] = useState(false);
118-
const [hideEmptyState, setHideEmptyState] = useState(false);
118+
const [showEmptyState, setShowEmptyState] = useState(true);
119119

120120
const events = context.room.currentState.events.get(eventType)!;
121121

@@ -152,15 +152,15 @@ const RoomStateExplorerEventType: React.FC<IEventTypeProps> = ({ eventType, onBa
152152
<BaseTool onBack={onBack}>
153153
<FilteredList query={query} onChange={setQuery}>
154154
{Array.from(events.entries())
155-
.filter(([_, ev]) => !hideEmptyState || Object.keys(ev.getContent()).length > 0)
155+
.filter(([_, ev]) => showEmptyState || Object.keys(ev.getContent()).length > 0)
156156
.map(([stateKey, ev]) => (
157157
<StateEventButton key={stateKey} label={stateKey} onClick={() => setEvent(ev)} />
158158
))}
159159
</FilteredList>
160160
<LabelledToggleSwitch
161-
label={_t("devtools|hide_empty_content_events")}
162-
onChange={setHideEmptyState}
163-
value={hideEmptyState}
161+
label={_t("devtools|show_empty_content_events")}
162+
onChange={setShowEmptyState}
163+
value={showEmptyState}
164164
/>
165165
</BaseTool>
166166
);

src/i18n/strings/en_EN.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,7 @@
819819
"failed_to_load": "Failed to load.",
820820
"failed_to_save": "Failed to save settings.",
821821
"failed_to_send": "Failed to send event!",
822-
"hide_empty_content_events": "Hide events with empty content",
822+
"show_empty_content_events": "Show events with empty content",
823823
"id": "ID: ",
824824
"invalid_json": "Doesn't look like valid JSON.",
825825
"level": "Level",

0 commit comments

Comments
 (0)