Honour feature toggles in guest mode (#10651)
* Honour feature toggles in guest mode * Suppress TS warning about returning null MatrixClient * Revert "Suppress TS warning about returning null MatrixClient" Don't ts-ignore this - we will eventually fix it via the strict work. This reverts commit 0c657e6afd4c69d07c39bc2783184f36feaf940f.
This commit is contained in:
parent
8c811776bb
commit
aa8c0f5cc7
2 changed files with 87 additions and 5 deletions
|
@ -16,7 +16,6 @@ See the License for the specific language governing permissions and
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
import { MatrixClientPeg } from "../../MatrixClientPeg";
|
||||
import { SettingLevel } from "../SettingLevel";
|
||||
import { CallbackFn, WatchManager } from "../WatchManager";
|
||||
import AbstractLocalStorageSettingsHandler from "./AbstractLocalStorageSettingsHandler";
|
||||
|
@ -117,10 +116,12 @@ export default class DeviceSettingsHandler extends AbstractLocalStorageSettingsH
|
|||
|
||||
// public for access to migrations - not exposed from the SettingsHandler interface
|
||||
public readFeature(featureName: string): boolean | null {
|
||||
if (MatrixClientPeg.get() && MatrixClientPeg.get().isGuest()) {
|
||||
// Guests should not have any labs features enabled.
|
||||
return false;
|
||||
}
|
||||
// Previously, we disabled all features for guests, but since different
|
||||
// installations can have site-specific config files which might set up
|
||||
// different behaviour that is relevant to guests, we removed that
|
||||
// special behaviour. See
|
||||
// https://github.com/vector-im/element-web/issues/24513 for the
|
||||
// discussion.
|
||||
|
||||
// XXX: This turns they key names into `mx_labs_feature_feature_x` (double feature).
|
||||
// This is because all feature names start with `feature_` as a matter of policy.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue