Skip to content

Commit

Permalink
Add new loader toggle UI in room settings
Browse files Browse the repository at this point in the history
This commit adds new loader toggle UI in room settings that allows
room owners to enable/disable the new loader.

Changes
* Rename hub.user_data.hubsUseNewLoader to
  hub.user_data.hubs_use_new_loader for naming consistency
* Add new loader toggle UI in room settings
  • Loading branch information
takahirox committed Oct 25, 2023
1 parent 50736ed commit 97da512
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/react-components/room/RoomSettingsSidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,16 @@ export function RoomSettingsSidebar({
/>
</div>
</InputField>
<InputField
label={<FormattedMessage id="room-settings-sidebar.new-loader" defaultMessage="New loader activation" />}
fullWidth
>
{/* TODO: Refresh the page in all the clients in the room when toggled */}
<ToggleInput
label={<FormattedMessage id="room-settings-sidebar.new-loader-activation" defaultMessage="Enable new loader" />}

Check failure on line 205 in src/react-components/room/RoomSettingsSidebar.js

View workflow job for this annotation

GitHub Actions / test-and-deploy-storybook

Replace `<FormattedMessage·id="room-settings-sidebar.new-loader-activation"·defaultMessage="Enable·new·loader"·/>` with `⏎··············<FormattedMessage·id="room-settings-sidebar.new-loader-activation"·defaultMessage="Enable·new·loader"·/>⏎············`
{...register("user_data.hubs_use_new_loader")}
/>
</InputField>
<ApplyButton type="submit" />
</Column>
</Sidebar>
Expand Down
1 change: 1 addition & 0 deletions src/react-components/room/RoomSettingsSidebarContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { useCallback } from "react";
import PropTypes from "prop-types";
import { RoomSettingsSidebar } from "./RoomSettingsSidebar";
import configs from "../../utils/configs";
import { fetchReticulumAuthenticated } from "../../utils/phoenix-utils";

Check failure on line 5 in src/react-components/room/RoomSettingsSidebarContainer.js

View workflow job for this annotation

GitHub Actions / test-and-deploy-storybook

'fetchReticulumAuthenticated' is defined but never used
import { useInviteUrl } from "./hooks/useInviteUrl";

const NotifiablePermissions = ["text_chat", "voice_chat"];
Expand Down
2 changes: 1 addition & 1 deletion src/utils/bit-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,5 @@ export function findChildWithComponent(world: HubsWorld, component: Component, e

const forceNewLoader = qsTruthy("newLoader");
export function shouldUseNewLoader() {
return forceNewLoader || APP.hub?.user_data?.hubsUseNewLoader;
return forceNewLoader || APP.hub?.user_data?.hubs_use_new_loader;
}

0 comments on commit 97da512

Please sign in to comment.