Skip to content

Commit

Permalink
remove blockaid announcement modal
Browse files Browse the repository at this point in the history
  • Loading branch information
piyalbasu committed Dec 10, 2024
1 parent 67f24aa commit d7fc2a2
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 239 deletions.
22 changes: 0 additions & 22 deletions @shared/api/internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1206,7 +1206,6 @@ export const saveSettings = async ({
settingsState: SettingsState.IDLE,
isSorobanPublicEnabled: false,
isNonSSLEnabled: false,
isBlockaidAnnounced: false,
isHideDustEnabled: true,
error: "",
};
Expand Down Expand Up @@ -1530,24 +1529,3 @@ export const simulateTransaction = async (args: {
response,
};
};

export const saveIsBlockaidAnnounced = async ({
isBlockaidAnnounced,
}: {
isBlockaidAnnounced: boolean;
}) => {
let response = {
error: "",
isBlockaidAnnounced: false,
};

response = await sendMessageToBackground({
type: SERVICE_TYPES.SAVE_IS_BLOCKAID_ANNOUNCED,
isBlockaidAnnounced,
});

return {
isBlockaidAnnounced: response.isBlockaidAnnounced,
error: response.error,
};
};
2 changes: 0 additions & 2 deletions @shared/api/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ export interface Response {
isMergeSelected: boolean;
recommendedFee: string;
isNonSSLEnabled: boolean;
isBlockaidAnnounced: boolean;
isHideDustEnabled: boolean;
}

Expand Down Expand Up @@ -146,7 +145,6 @@ export interface Preferences {
isMemoValidationEnabled: boolean;
networksList: NetworkDetails[];
isHideDustEnabled: boolean;
isBlockaidAnnounced: boolean;
error: string;
}

Expand Down
1 change: 0 additions & 1 deletion @shared/constants/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ export enum SERVICE_TYPES {
MIGRATE_ACCOUNTS = "MIGRATE_ACCOUNTS",
ADD_ASSETS_LIST = "ADD_ASSETS_LIST",
MODIFY_ASSETS_LIST = "MODIFY_ASSETS_LIST",
SAVE_IS_BLOCKAID_ANNOUNCED = "SAVE_IS_BLOCKAID_ANNOUNCED",
}

export enum EXTERNAL_SERVICE_TYPES {
Expand Down
2 changes: 0 additions & 2 deletions extension/e2e-tests/helpers/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export const login = async ({ page, extensionId }) => {
});

await page.goto(`chrome-extension://${extensionId}/index.html#/account`);
await page.getByTestId("BlockaidAnnouncement__accept").click();
await expect(page.getByTestId("network-selector-open")).toBeVisible({
timeout: 10000,
});
Expand Down Expand Up @@ -90,7 +89,6 @@ export const loginToTestAccount = async ({ page, extensionId }) => {
});

await page.goto(`chrome-extension://${extensionId}/index.html#/account`);
await page.getByTestId("BlockaidAnnouncement__accept").click();
await expect(page.getByTestId("network-selector-open")).toBeVisible({
timeout: 50000,
});
Expand Down
11 changes: 0 additions & 11 deletions extension/src/background/helpers/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
ASSETS_LISTS_ID,
IS_HASH_SIGNING_ENABLED_ID,
IS_NON_SSL_ENABLED_ID,
IS_BLOCKAID_ANNOUNCED_ID,
IS_HIDE_DUST_ENABLED_ID,
LAST_USED_ACCOUNT,
} from "constants/localStorageTypes";
Expand Down Expand Up @@ -156,16 +155,6 @@ export const getIsNonSSLEnabled = async () => {
return isNonSSLEnabled;
};

export const getIsBlockaidAnnounced = async () => {
if (!(await localStore.getItem(IS_BLOCKAID_ANNOUNCED_ID))) {
await localStore.setItem(IS_BLOCKAID_ANNOUNCED_ID, false);
}
const isBlockaidAnnounced =
(await localStore.getItem(IS_BLOCKAID_ANNOUNCED_ID)) ?? false;

return isBlockaidAnnounced;
};

export const getIsHideDustEnabled = async () => {
const isHideDustEnabled =
(await localStore.getItem(IS_HIDE_DUST_ENABLED_ID)) ?? true;
Expand Down
13 changes: 0 additions & 13 deletions extension/src/background/messageListener/popupMessageListener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ import {
TOKEN_ID_LIST,
IS_HASH_SIGNING_ENABLED_ID,
IS_NON_SSL_ENABLED_ID,
IS_BLOCKAID_ANNOUNCED_ID,
IS_HIDE_DUST_ENABLED_ID,
} from "constants/localStorageTypes";
import {
Expand Down Expand Up @@ -80,7 +79,6 @@ import {
getNetworksList,
getAssetsLists,
getIsNonSSLEnabled,
getIsBlockaidAnnounced,
getIsHideDustEnabled,
HW_PREFIX,
getBipPath,
Expand Down Expand Up @@ -1317,7 +1315,6 @@ export const popupMessageListener = (request: Request, sessionStore: Store) => {
const isHashSigningEnabled = await getIsHashSigningEnabled();
const assetsLists = await getAssetsLists();
const isNonSSLEnabled = await getIsNonSSLEnabled();
const isBlockaidAnnounced = await getIsBlockaidAnnounced();
const isHideDustEnabled = await getIsHideDustEnabled();

return {
Expand All @@ -1333,7 +1330,6 @@ export const popupMessageListener = (request: Request, sessionStore: Store) => {
userNotification,
assetsLists,
isNonSSLEnabled,
isBlockaidAnnounced,
isHideDustEnabled,
};
};
Expand Down Expand Up @@ -1770,14 +1766,6 @@ export const popupMessageListener = (request: Request, sessionStore: Store) => {
return { assetsLists: await getAssetsLists() };
};

const saveIsBlockaidAnnounced = async () => {
const { isBlockaidAnnounced } = request;

await localStore.setItem(IS_BLOCKAID_ANNOUNCED_ID, isBlockaidAnnounced);

return { isBlockaidAnnounced: await getIsBlockaidAnnounced() };
};

const messageResponder: MessageResponder = {
[SERVICE_TYPES.CREATE_ACCOUNT]: createAccount,
[SERVICE_TYPES.FUND_ACCOUNT]: fundAccount,
Expand Down Expand Up @@ -1830,7 +1818,6 @@ export const popupMessageListener = (request: Request, sessionStore: Store) => {
[SERVICE_TYPES.MIGRATE_ACCOUNTS]: migrateAccounts,
[SERVICE_TYPES.ADD_ASSETS_LIST]: addAssetsList,
[SERVICE_TYPES.MODIFY_ASSETS_LIST]: modifyAssetsList,
[SERVICE_TYPES.SAVE_IS_BLOCKAID_ANNOUNCED]: saveIsBlockaidAnnounced,
};

return messageResponder[request.type]();
Expand Down

This file was deleted.

This file was deleted.

45 changes: 0 additions & 45 deletions extension/src/popup/ducks/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
editCustomNetwork as editCustomNetworkService,
addAssetsList as addAssetsListService,
modifyAssetsList as modifyAssetsListService,
saveIsBlockaidAnnounced as saveIsBlockaidAnnouncedService,
} from "@shared/api/internal";
import {
NETWORKS,
Expand Down Expand Up @@ -56,7 +55,6 @@ const settingsInitialState: Settings = {
networksList: DEFAULT_NETWORKS,
isMemoValidationEnabled: true,
isHideDustEnabled: true,
isBlockaidAnnounced: false,
error: "",
};

Expand Down Expand Up @@ -274,29 +272,6 @@ export const modifyAssetsList = createAsyncThunk<
},
);

export const saveIsBlockaidAnnounced = createAsyncThunk<
{ isBlockaidAnnounced: boolean },
{
isBlockaidAnnounced: boolean;
},
{ rejectValue: ErrorMessage }
>(
"settings/saveIsBlockaidAnnounced",
async ({ isBlockaidAnnounced }, thunkApi) => {
const res = await saveIsBlockaidAnnouncedService({
isBlockaidAnnounced,
});

if (res.error) {
return thunkApi.rejectWithValue({
errorMessage: res.error || "Unable to save isBlockaidAnnounced",
});
}

return res;
},
);

const settingsSlice = createSlice({
name: "settings",
initialState,
Expand Down Expand Up @@ -396,7 +371,6 @@ const settingsSlice = createSlice({
userNotification,
assetsLists,
isNonSSLEnabled,
isBlockaidAnnounced,
isHideDustEnabled,
} = action?.payload || {
...initialState,
Expand All @@ -416,7 +390,6 @@ const settingsSlice = createSlice({
userNotification,
assetsLists,
isNonSSLEnabled,
isBlockaidAnnounced,
isHideDustEnabled,
settingsState: SettingsState.SUCCESS,
};
Expand Down Expand Up @@ -562,24 +535,6 @@ const settingsSlice = createSlice({
};
},
);
builder.addCase(
saveIsBlockaidAnnounced.fulfilled,
(
state,
action: PayloadAction<{
isBlockaidAnnounced: boolean;
}>,
) => {
const { isBlockaidAnnounced } = action?.payload || {
isBlockaidAnnounced: initialState.isBlockaidAnnounced,
};

return {
...state,
isBlockaidAnnounced,
};
},
);
},
});

Expand Down
2 changes: 0 additions & 2 deletions extension/src/popup/views/Account/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ import { AccountOptionsDropdown } from "popup/components/account/AccountOptionsD
import { AssetDetail } from "popup/components/account/AssetDetail";
import { Loading } from "popup/components/Loading";
import { NotFundedMessage } from "popup/components/account/NotFundedMessage";
import { BlockaidAnnouncement } from "popup/components/account/BlockaidAnnouncement";

import "popup/metrics/authServices";

Expand Down Expand Up @@ -178,7 +177,6 @@ export const Account = () => {
publicKey={publicKey}
setLoading={setLoading}
/>
<BlockaidAnnouncement />
<View.Content hasNoTopPadding>
<div className="AccountView" data-testid="account-view">
<div className="AccountView__account-actions">
Expand Down

0 comments on commit d7fc2a2

Please sign in to comment.