fix(rn,sdk) remove deprecated color scheme prop

It has been non-functional for a while.
This commit is contained in:
Saúl Ibarra Corretgé 2021-11-23 12:15:13 +01:00 committed by Saúl Ibarra Corretgé
parent 76a976b5d1
commit f6f7406d24
11 changed files with 2 additions and 123 deletions

View File

@ -45,11 +45,6 @@ public class JitsiMeetConferenceOptions implements Parcelable {
*/
private String token;
/**
* Color scheme override, see: https://github.com/jitsi/jitsi-meet/blob/dbedee5e22e5dcf9c92db96ef5bb3c9982fc526d/react/features/base/color-scheme/defaultScheme.js
*/
private Bundle colorScheme;
/**
* Config. See: https://github.com/jitsi/jitsi-meet/blob/master/config.js
*/
@ -77,10 +72,6 @@ public class JitsiMeetConferenceOptions implements Parcelable {
return token;
}
public Bundle getColorScheme() {
return colorScheme;
}
public Bundle getFeatureFlags() {
return featureFlags;
}
@ -97,7 +88,6 @@ public class JitsiMeetConferenceOptions implements Parcelable {
private String room;
private String token;
private Bundle colorScheme;
private Bundle config;
private Bundle featureFlags;
@ -152,19 +142,6 @@ public class JitsiMeetConferenceOptions implements Parcelable {
return this;
}
/**
* Sets the color scheme override so the app is themed. See:
* https://github.com/jitsi/jitsi-meet/blob/master/react/features/base/color-scheme/defaultScheme.js
* for the structure.
* @param colorScheme - A color scheme to be applied to the app.
* @return - The {@link Builder} object itself so the method calls can be chained.
*/
public Builder setColorScheme(Bundle colorScheme) {
this.colorScheme = colorScheme;
return this;
}
/**
* Indicates the conference will be joined with the microphone muted.
* @param audioMuted - Muted indication.
@ -276,7 +253,6 @@ public class JitsiMeetConferenceOptions implements Parcelable {
options.serverURL = this.serverURL;
options.room = this.room;
options.token = this.token;
options.colorScheme = this.colorScheme;
options.config = this.config;
options.featureFlags = this.featureFlags;
options.userInfo = this.userInfo;
@ -292,7 +268,6 @@ public class JitsiMeetConferenceOptions implements Parcelable {
serverURL = (URL) in.readSerializable();
room = in.readString();
token = in.readString();
colorScheme = in.readBundle();
config = in.readBundle();
featureFlags = in.readBundle();
userInfo = new JitsiMeetUserInfo(in.readBundle());
@ -308,10 +283,6 @@ public class JitsiMeetConferenceOptions implements Parcelable {
props.putBundle("flags", featureFlags);
if (colorScheme != null) {
props.putBundle("colorScheme", colorScheme);
}
Bundle urlProps = new Bundle();
// The room is fully qualified
@ -360,7 +331,6 @@ public class JitsiMeetConferenceOptions implements Parcelable {
dest.writeSerializable(serverURL);
dest.writeString(room);
dest.writeString(token);
dest.writeBundle(colorScheme);
dest.writeBundle(config);
dest.writeBundle(featureFlags);
dest.writeBundle(userInfo != null ? userInfo.asBundle() : new Bundle());

View File

@ -34,12 +34,6 @@
*/
@property (nonatomic, copy, nullable) NSString *token;
/**
* Color scheme override, see:
* https://github.com/jitsi/jitsi-meet/blob/master/react/features/base/color-scheme/defaultScheme.js
*/
@property (nonatomic, copy, nullable) NSDictionary *colorScheme;
/**
* Feature flags. See: https://github.com/jitsi/jitsi-meet/blob/master/react/features/base/flags/constants.js
*/
@ -82,7 +76,6 @@
@property (nonatomic, copy, nullable, readonly) NSString *room;
@property (nonatomic, copy, nullable, readonly) NSString *token;
@property (nonatomic, copy, nullable) NSDictionary *colorScheme;
@property (nonatomic, readonly, nonnull) NSDictionary *featureFlags;
@property (nonatomic, readonly) BOOL welcomePageEnabled;

View File

@ -38,7 +38,6 @@ static NSString *const WelcomePageEnabledFeatureFlag = @"welcomepage.enabled";
_room = nil;
_token = nil;
_colorScheme = nil;
_config = [[NSMutableDictionary alloc] init];
_featureFlags = [[NSMutableDictionary alloc] init];
@ -134,8 +133,6 @@ static NSString *const WelcomePageEnabledFeatureFlag = @"welcomepage.enabled";
_room = builder.room;
_token = builder.token;
_colorScheme = builder.colorScheme;
_config = builder.config;
_featureFlags = [NSDictionary dictionaryWithDictionary:builder.featureFlags];
@ -161,10 +158,6 @@ static NSString *const WelcomePageEnabledFeatureFlag = @"welcomepage.enabled";
props[@"flags"] = [NSMutableDictionary dictionaryWithDictionary:_featureFlags];
if (_colorScheme != nil) {
props[@"colorScheme"] = self.colorScheme;
}
NSMutableDictionary *urlProps = [[NSMutableDictionary alloc] init];
// The room is fully qualified.

View File

@ -3,7 +3,6 @@
import React from 'react';
import SplashScreen from 'react-native-splash-screen';
import { setColorScheme } from '../../base/color-scheme';
import { DialogContainer } from '../../base/dialog';
import { updateFlags } from '../../base/flags/actions';
import { CALL_INTEGRATION_ENABLED, SERVER_URL_CHANGE_ENABLED } from '../../base/flags/constants';
@ -91,7 +90,6 @@ export class App extends AbstractApp {
const { dispatch, getState } = this.state.store;
// We set these early enough so then we avoid any unnecessary re-renders.
dispatch(setColorScheme(this.props.colorScheme));
dispatch(updateFlags(this.props.flags));
// Check if serverURL is configured externally and not allowed to change.

View File

@ -5,7 +5,6 @@ import '../authentication/reducer';
import '../av-moderation/reducer';
import '../base/app/reducer';
import '../base/audio-only/reducer';
import '../base/color-scheme/reducer';
import '../base/conference/reducer';
import '../base/config/reducer';
import '../base/connection/reducer';

View File

@ -23,8 +23,7 @@ class ColorSchemeRegistry {
_styleTemplates = new Map();
/**
* Clears the already scheme-ified style definitions. This is useful when
* the {@code SET_COLOR_SCHEME} action is dispatched (again).
* Clears the already scheme-ified style definitions.
*
* @returns {void}
*/
@ -150,7 +149,7 @@ class ColorSchemeRegistry {
stateful: Object | Function,
componentName: string,
colorDefinition: string): string {
const colorScheme = toState(stateful)['features/base/color-scheme'];
const colorScheme = toState(stateful)['features/base/color-scheme'] || {};
return {
...defaultScheme._defaultTheme,

View File

@ -1,11 +0,0 @@
// @flow
/**
* Redux action to signal a color scheme change in the app/sdk.
*
* {
* type: SET_COLOR_SCHEME
* colorScheme: Object
* }
*/
export const SET_COLOR_SCHEME = 'SET_COLOR_SCHEME';

View File

@ -1,19 +0,0 @@
// @flow
import { SET_COLOR_SCHEME } from './actionTypes';
/**
* Dispatches a Redux action to set the color scheme of the app/sdk.
*
* @param {Object} colorScheme - The color scheme to set.
* @returns {{
* type: SET_COLOR_SCHEME,
* colorScheme: Object
* }}
*/
export function setColorScheme(colorScheme: Object): Object {
return {
type: SET_COLOR_SCHEME,
colorScheme
};
}

View File

@ -1,6 +1,4 @@
// @flow
export * from './actions';
export * from './actionTypes';
export * from './functions';
export { default as ColorSchemeRegistry } from './ColorSchemeRegistry';

View File

@ -1,20 +0,0 @@
// @flow
import { MiddlewareRegistry } from '../redux';
import ColorSchemeRegistry from './ColorSchemeRegistry';
import { SET_COLOR_SCHEME } from './actionTypes';
/**
* The middleware of the feature {@code base/color-scheme}.
*
* @returns {Function}
*/
MiddlewareRegistry.register((/* store */) => next => action => {
switch (action.type) {
case SET_COLOR_SCHEME:
return ColorSchemeRegistry.clear();
}
return next(action);
});

View File

@ -1,21 +0,0 @@
// @flow
import _ from 'lodash';
import { ReducerRegistry } from '../redux';
import { SET_COLOR_SCHEME } from './actionTypes';
/**
* The reducer of the feature {@code base/color-scheme}.
*
* @returns {Function}
*/
ReducerRegistry.register('features/base/color-scheme', (state = {}, action) => {
switch (action.type) {
case SET_COLOR_SCHEME:
return _.cloneDeep(action.colorScheme) || state;
}
return state;
});