Skip to content

Commit

Permalink
Revert "Adrienne / integrated useSubscription hook for website status (
Browse files Browse the repository at this point in the history
…deriv-com#8702)" (deriv-com#9278)

This reverts commit 4f7c079.
  • Loading branch information
jim-deriv authored Jul 7, 2023
1 parent dd49681 commit a34b81a
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 62 deletions.
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;
};

0 comments on commit a34b81a

Please sign in to comment.