Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Adrienne / integrated useSubscription hook for website status" #9278

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ describe('<CFDServerErrorDialog /> ', () => {
let mockRootStore;
beforeEach(() => {
mockRootStore = {
client: {
is_authorize: false,
},
ui: {
disableApp: jest.fn(),
enableApp: jest.fn(),
Expand Down Expand Up @@ -56,9 +53,6 @@ describe('<CFDServerErrorDialog /> ', () => {

it('should not render the component if has_cfd_error is false', () => {
const new_mockRootStore = {
client: {
is_authorize: false,
},
ui: {
...mockRootStore.ui,
},
Expand All @@ -78,9 +72,6 @@ describe('<CFDServerErrorDialog /> ', () => {

it('should not render the component if is_cfd_success_dialog_enabled', () => {
const new_mockRootStore = {
client: {
is_authorize: false,
},
ui: {
...mockRootStore.ui,
},
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/Stores/client-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -2118,8 +2118,8 @@ export default class ClientStore extends BaseStore {

if (response?.logout === 1) {
this.cleanUp();

RudderStack.reset();
this.setIsAuthorize(false);
this.setLogout(true);
}

Expand Down
5 changes: 0 additions & 5 deletions packages/stores/src/mockStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,11 +432,6 @@ const mock = (): TStores & { is_mock: boolean } => {
update: jest.fn(),
unmount: jest.fn(),
},
website_status: {
data: undefined,
update: jest.fn(),
unmount: jest.fn(),
},
feature_flags: {
data: undefined,
update: jest.fn(),
Expand Down
29 changes: 0 additions & 29 deletions packages/stores/src/providers/WebsiteStatusProvider.tsx

This file was deleted.

1 change: 0 additions & 1 deletion packages/stores/src/providers/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export { default as ExchangeRatesProvider } from './ExchangeRatesProvider';
export { default as WebsiteStatusProvider } from './WebsiteStatusProvider';
9 changes: 3 additions & 6 deletions packages/stores/src/storeProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useEffect, useMemo } from 'react';
import { ExchangeRatesProvider } from './providers';
import StoreContext from './storeContext';
import { ExchangeRatesStore, FeatureFlagsStore, WebsiteStatusStore } from './stores';
import { ExchangeRatesProvider, WebsiteStatusProvider } from './providers';
import { ExchangeRatesStore, FeatureFlagsStore } from './stores';
import type { TCoreStores, TStores } from '../types';

const StoreProvider = ({ children, store }: React.PropsWithChildren<{ store: TCoreStores }>) => {
Expand All @@ -14,7 +14,6 @@ const StoreProvider = ({ children, store }: React.PropsWithChildren<{ store: TCo
...store,
exchange_rates: new ExchangeRatesStore(),
feature_flags: new FeatureFlagsStore(),
website_status: new WebsiteStatusStore(),
};
}, [store]);

Expand All @@ -28,9 +27,7 @@ const StoreProvider = ({ children, store }: React.PropsWithChildren<{ store: TCo

return (
<StoreContext.Provider value={memoizedValue}>
<WebsiteStatusProvider>
<ExchangeRatesProvider>{children}</ExchangeRatesProvider>
</WebsiteStatusProvider>
<ExchangeRatesProvider>{children}</ExchangeRatesProvider>
</StoreContext.Provider>
);
};
Expand Down
8 changes: 0 additions & 8 deletions packages/stores/src/stores/WebsiteStatusStore.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/stores/src/stores/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export { default as ExchangeRatesStore } from './ExchangeRatesStore';
export { default as FeatureFlagsStore } from './FeatureFlagsStore';
export { default as WebsiteStatusStore } from './WebsiteStatusStore';
3 changes: 1 addition & 2 deletions packages/stores/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import type {
} from '@deriv/api-types';
import type { Moment } from 'moment';
import type { RouteComponentProps } from 'react-router';
import type { ExchangeRatesStore, FeatureFlagsStore, WebsiteStatusStore } from './src/stores';
import type { ExchangeRatesStore, FeatureFlagsStore } from './src/stores';

type TPopulateSettingsExtensionsMenuItem = {
icon: string;
Expand Down Expand Up @@ -498,6 +498,5 @@ export type TCoreStores = {

export type TStores = TCoreStores & {
exchange_rates: ExchangeRatesStore;
website_status: WebsiteStatusStore;
feature_flags: FeatureFlagsStore;
};
Loading