Merge branch 'release/3.8.26' into main
This commit is contained in:
@@ -37,12 +37,22 @@ const PREFERENCES_MENU_ITEMS: PreferencesMenuItem[] = [
|
||||
{ id: 'help-feedback', label: 'Help & feedback', icon: 'help' },
|
||||
];
|
||||
|
||||
const READY_PREFERENCES_MENU_ITEMS: PreferencesMenuItem[] = [
|
||||
{ id: 'general', label: 'General', icon: 'settings' },
|
||||
{ id: 'account', label: 'Account', icon: 'user' },
|
||||
{ id: 'security', label: 'Security', icon: 'security' },
|
||||
{ id: 'listed', label: 'Listed', icon: 'listed' },
|
||||
{ id: 'help-feedback', label: 'Help & feedback', icon: 'help' },
|
||||
];
|
||||
|
||||
export class PreferencesMenu {
|
||||
private _selectedPane: PreferenceId = 'general';
|
||||
private _menu: PreferencesMenuItem[];
|
||||
|
||||
constructor(
|
||||
private readonly _menu: PreferencesMenuItem[] = PREFERENCES_MENU_ITEMS
|
||||
private readonly _enableUnfinishedFeatures: boolean,
|
||||
) {
|
||||
this._menu = this._enableUnfinishedFeatures ? PREFERENCES_MENU_ITEMS : READY_PREFERENCES_MENU_ITEMS;
|
||||
makeAutoObservable<PreferencesMenu, '_selectedPane' | '_twoFactorAuth'>(
|
||||
this,
|
||||
{
|
||||
|
||||
@@ -75,7 +75,9 @@ const PreferencesCanvas: FunctionComponent<
|
||||
|
||||
export const PreferencesView: FunctionComponent<PreferencesProps> = observer(
|
||||
(props) => {
|
||||
const menu = useMemo(() => new PreferencesMenu(), []);
|
||||
const menu = useMemo(() => new PreferencesMenu(props.appState.enableUnfinishedFeatures), [
|
||||
props.appState.enableUnfinishedFeatures
|
||||
]);
|
||||
|
||||
useEffect(() => {
|
||||
menu.selectPane(props.appState.preferences.currentPane);
|
||||
|
||||
@@ -22,7 +22,7 @@ export const AccountPreferences = observer(
|
||||
return (
|
||||
<PreferencesPane>
|
||||
<Authentication application={application} appState={appState} />
|
||||
<SubscriptionWrapper application={application} />
|
||||
{appState.enableUnfinishedFeatures && <SubscriptionWrapper application={application} />}
|
||||
<SignOutWrapper application={application} appState={appState} />
|
||||
</PreferencesPane>
|
||||
);
|
||||
@@ -32,6 +32,7 @@ export const AccountPreferences = observer(
|
||||
<PreferencesPane>
|
||||
<Credentials application={application} />
|
||||
<Sync application={application} />
|
||||
{appState.enableUnfinishedFeatures && <SubscriptionWrapper application={application} />}
|
||||
<SignOutWrapper application={application} appState={appState} />
|
||||
</PreferencesPane>
|
||||
);
|
||||
|
||||
@@ -21,7 +21,7 @@ export const Subscription: FunctionComponent<Props> = observer(({
|
||||
application,
|
||||
subscriptionState,
|
||||
}: Props) => {
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [error, setError] = useState(false);
|
||||
|
||||
const { userSubscription } = subscriptionState;
|
||||
@@ -59,8 +59,10 @@ export const Subscription: FunctionComponent<Props> = observer(({
|
||||
}, [getSubscription, getSubscriptions]);
|
||||
|
||||
useEffect(() => {
|
||||
getSubscriptionInfo();
|
||||
}, [getSubscriptionInfo]);
|
||||
if (application.hasAccount()) {
|
||||
getSubscriptionInfo();
|
||||
}
|
||||
}, [application, getSubscriptionInfo]);
|
||||
|
||||
const now = new Date().getTime();
|
||||
|
||||
@@ -71,7 +73,7 @@ export const Subscription: FunctionComponent<Props> = observer(({
|
||||
<div className="flex-grow flex flex-col">
|
||||
<Title>Subscription</Title>
|
||||
{error ? (
|
||||
<NoSubscription application={application} />
|
||||
<Text>No subscription information available.</Text>
|
||||
) : loading ? (
|
||||
<Text>Loading subscription information...</Text>
|
||||
) : userSubscription && userSubscription.endsAt > now ? (
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
)
|
||||
.sk-app-bar-item.ml-0-important(
|
||||
ng-click='ctrl.clickPreferences()'
|
||||
ng-if='ctrl.appState.enableUnfinishedFeatures'
|
||||
)
|
||||
.w-8.h-full.flex.items-center.justify-center.cursor-pointer
|
||||
.h-5
|
||||
|
||||
Reference in New Issue
Block a user