Skip to content

Commit 3b40921

Browse files
committed
chore: add logs when section is unknown
1 parent 0caaac2 commit 3b40921

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

apps/web/src/stores/room-list-v3/section.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
* Please see LICENSE files in the repository root for full details.
66
*/
77

8+
import { logger } from "matrix-js-sdk/src/logger";
9+
810
import { SettingLevel } from "../../settings/SettingLevel";
911
import SettingsStore from "../../settings/SettingsStore";
1012
import Modal from "../../Modal";
@@ -78,7 +80,10 @@ export async function createSection(): Promise<string | undefined> {
7880
export async function editSection(tag: string): Promise<void> {
7981
const sectionData = SettingsStore.getValue("RoomList.CustomSectionData") || {};
8082
const section = sectionData[tag];
81-
if (!section) return;
83+
if (!section) {
84+
logger.info("Unknown section tag, cannot edit section", tag);
85+
return;
86+
}
8287

8388
const modal = Modal.createDialog(CreateSectionDialog, { sectionToEdit: section.name });
8489

@@ -97,7 +102,10 @@ export async function editSection(tag: string): Promise<void> {
97102
*/
98103
export async function deleteSection(tag: string): Promise<void> {
99104
const sectionData = SettingsStore.getValue("RoomList.CustomSectionData");
100-
if (!sectionData[tag]) return;
105+
if (!sectionData[tag]) {
106+
logger.info("Unknown section tag, cannot delete section", tag);
107+
return;
108+
}
101109

102110
const modal = Modal.createDialog(RemoveSectionDialog);
103111
const [shouldRemoveSection] = await modal.finished;

0 commit comments

Comments
 (0)