Skip to content

Commit 93095f9

Browse files
RiotRobotdbkr
andauthored
Allow /upgraderoom command without developer mode enabled (#30527) (#30529)
* Allow /upgraderoom command without developer mode enabled This will make the instructions for upgrading rooms for hydra a lot more straightforward, so maybe let's do this at least while hydra upgrades happen. * Update test to match * Unused imports (cherry picked from commit 4d3fde1) Co-authored-by: David Baker <[email protected]>
1 parent adfa43d commit 93095f9

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

src/SlashCommands.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ export const Commands = [
148148
command: "upgraderoom",
149149
args: "<new_version>",
150150
description: _td("slash_command|upgraderoom"),
151-
isEnabled: (cli) => !isCurrentLocalRoom(cli) && SettingsStore.getValue("developerMode"),
151+
isEnabled: (cli) => !isCurrentLocalRoom(cli),
152152
runFn: function (cli, roomId, threadId, args) {
153153
if (args) {
154154
const room = cli.getRoom(roomId);

test/unit-tests/SlashCommands-test.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@ import { act, waitFor } from "jest-matrix-react";
1414
import { type Command, Commands, getCommand } from "../../src/SlashCommands";
1515
import { createTestClient } from "../test-utils";
1616
import { LocalRoom, LOCAL_ROOM_ID_PREFIX } from "../../src/models/LocalRoom";
17-
import SettingsStore from "../../src/settings/SettingsStore";
1817
import { SdkContextClass } from "../../src/contexts/SDKContext";
1918
import Modal, { type ComponentType, type IHandle } from "../../src/Modal";
2019
import WidgetUtils from "../../src/utils/WidgetUtils";
2120
import { WidgetType } from "../../src/widgets/WidgetType";
2221
import { warnSelfDemote } from "../../src/components/views/right_panel/UserInfo";
2322
import dispatcher from "../../src/dispatcher/dispatcher";
24-
import { SettingLevel } from "../../src/settings/SettingLevel";
2523
import QuestionDialog from "../../src/components/views/dialogs/QuestionDialog";
2624
import ErrorDialog from "../../src/components/views/dialogs/ErrorDialog";
2725

@@ -127,12 +125,7 @@ describe("SlashCommands", () => {
127125
setCurrentRoom();
128126
});
129127

130-
it("should be disabled by default", () => {
131-
expect(command.isEnabled(client)).toBe(false);
132-
});
133-
134-
it("should be enabled for developerMode", () => {
135-
SettingsStore.setValue("developerMode", null, SettingLevel.DEVICE, true);
128+
it("should be enabled by default", () => {
136129
expect(command.isEnabled(client)).toBe(true);
137130
});
138131
});

0 commit comments

Comments
 (0)