Skip to content

Commit

Permalink
merge main and solve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
tommasini committed Jul 29, 2024
2 parents 9ba4946 + 3534cce commit 3a57e13
Show file tree
Hide file tree
Showing 168 changed files with 7,800 additions and 5,344 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ async function main(): Promise<void> {
// We can't use "GITHUB_TOKEN" here, as its permissions are scoped to the repository where the action is running.
// "GITHUB_TOKEN" does not have access to other repositories, even when they belong to the same organization.
// As we want to get files which are not necessarily located in the same repository,
// we need to create our own "RELEASE_LABEL_TOKEN" with "repo" permissions.
// we need to create our own "PERSONAL_ACCESS_TOKEN" with "repo" permissions.
// Such a token allows to access other repositories of the MetaMask organisation.
const personalAccessToken = process.env.RELEASE_LABEL_TOKEN;
const personalAccessToken = process.env.PERSONAL_ACCESS_TOKEN;
if (!personalAccessToken) {
core.setFailed('RELEASE_LABEL_TOKEN not found');
core.setFailed('PERSONAL_ACCESS_TOKEN not found');
process.exit(1);
}

Expand Down
33 changes: 4 additions & 29 deletions .github/workflows/add-team-label.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Add team label to PR when it is opened
name: Add team label

on:
pull_request:
Expand All @@ -7,31 +7,6 @@ on:

jobs:
add-team-label:
runs-on: ubuntu-latest
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'

- run: corepack enable

- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # This is needed to checkout all branches

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: yarn

- name: Install dependencies
run: yarn --immutable

- name: Add team label to PR
id: add-team-label-to-pr
env:
RELEASE_LABEL_TOKEN: ${{ secrets.RELEASE_LABEL_TOKEN }}
run: yarn run add-team-label-to-pr
uses: metamask/github-tools/.github/workflows/add-team-label.yml@7c10eb3bafb3f221111a9e4309ae5dcaee171de5
secrets:
PERSONAL_ACCESS_TOKEN: ${{ secrets.RELEASE_LABEL_TOKEN }}
36 changes: 0 additions & 36 deletions app/actions/transaction/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,42 +144,6 @@ export function setEtherTransaction(transaction) {
};
}

/**
* Enable individual ERC20 asset only to send in a transaction
*
* @param {object} token - Token object to be sent
*/
export function setIndividualTokenTransaction(token) {
return {
type: 'SET_INDIVIDUAL_TOKEN_TRANSACTION',
token,
};
}

/**
* Enable individual ERC721 asset only to send in a transaction
*
* @param {object} collectible - Collectible object to be sent
*/
export function setIndividualCollectibleTransaction(collectible) {
return {
type: 'SET_INDIVIDUAL_COLLECTIBLE_TRANSACTION',
collectible,
};
}

/**
* Enable selectable ERC721 assets who's current account is owner of a specific contract to be sent in a transaction
*
* @param {object} collectible - Collectible of the type contract collectible that the user wants to send
*/
export function setCollectibleContractTransaction(collectible) {
return {
type: 'SET_COLLECTIBLE_CONTRACT_TRANSACTION',
collectible,
};
}

export function setNonce(nonce) {
return {
type: 'SET_NONCE',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export interface HeaderBaseProps extends ViewProps {
/**
* Title of the HeaderBase.
*/
children: React.ReactNode;
children?: React.ReactNode | string;
/**
* Optional prop to include content to be displayed before the title.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import PickerBase from '../PickerBase';
import { PickerAccountProps } from './PickerAccount.types';
import styleSheet from './PickerAccount.styles';
import { WalletViewSelectorsIDs } from '../../../../../e2e/selectors/wallet/WalletView.selectors';
import { AccountListViewSelectorsIDs } from '../../../../../e2e/selectors/AccountListView.selectors';

const PickerAccount: React.ForwardRefRenderFunction<
TouchableOpacity,
Expand Down Expand Up @@ -59,6 +60,7 @@ const PickerAccount: React.ForwardRefRenderFunction<
<Text
variant={TextVariant.BodySM}
style={styles.accountNameLabelText}
testID={AccountListViewSelectorsIDs.ACCOUNT_TYPE_LABEL}
>
{strings(accountTypeLabel)}
</Text>
Expand Down
25 changes: 15 additions & 10 deletions app/components/Nav/App/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ import { DevLogger } from '../../../../app/core/SDKConnect/utils/DevLogger';
import { PPOMView } from '../../../lib/ppom/PPOMView';
import NavigationService from '../../../core/NavigationService';
import LockScreen from '../../Views/LockScreen';
import AsyncStorage from '../../../store/async-storage-wrapper';
import StorageWrapper from '../../../store/storage-wrapper';
import ShowIpfsGatewaySheet from '../../Views/ShowIpfsGatewaySheet/ShowIpfsGatewaySheet';
import ShowDisplayNftMediaSheet from '../../Views/ShowDisplayMediaNFTSheet/ShowDisplayNFTMediaSheet';
import AmbiguousAddressSheet from '../../../../app/components/Views/Settings/Contacts/AmbiguousAddressSheet/AmbiguousAddressSheet';
Expand All @@ -116,6 +116,7 @@ import BasicFunctionalityModal from '../../UI/BasicFunctionality/BasicFunctional
import SmartTransactionsOptInModal from '../../Views/SmartTransactionsOptInModal/SmartTranactionsOptInModal';
import ProfileSyncingModal from '../../UI/ProfileSyncing/ProfileSyncingModal/ProfileSyncingModal';
import NFTAutoDetectionModal from '../../../../app/components/Views/NFTAutoDetectionModal/NFTAutoDetectionModal';
import OriginSpamModal from '../../Views/OriginSpamModal/OriginSpamModal';
///: BEGIN:ONLY_INCLUDE_IF(preinstalled-snaps,external-snaps)
import { SnapsExecutionWebView } from '../../../lib/snaps';
///: END:ONLY_INCLUDE_IF
Expand Down Expand Up @@ -325,7 +326,7 @@ const App = ({ userLoggedIn }) => {
useEffect(() => {
if (prevNavigator.current || !navigator) return;
const appTriggeredAuth = async () => {
const existingUser = await AsyncStorage.getItem(EXISTING_USER);
const existingUser = await StorageWrapper.getItem(EXISTING_USER);
try {
if (existingUser) {
await Authentication.appTriggeredAuth();
Expand Down Expand Up @@ -498,7 +499,7 @@ const App = ({ userLoggedIn }) => {

useEffect(() => {
async function checkExisting() {
const existingUser = await AsyncStorage.getItem(EXISTING_USER);
const existingUser = await StorageWrapper.getItem(EXISTING_USER);
setOnboarded(!!existingUser);
const route = !existingUser
? Routes.ONBOARDING.ROOT_NAV
Expand All @@ -514,24 +515,24 @@ const App = ({ userLoggedIn }) => {

useEffect(() => {
async function startApp() {
const existingUser = await AsyncStorage.getItem(EXISTING_USER);
const existingUser = await StorageWrapper.getItem(EXISTING_USER);
try {
const currentVersion = getVersion();
const savedVersion = await AsyncStorage.getItem(CURRENT_APP_VERSION);
const savedVersion = await StorageWrapper.getItem(CURRENT_APP_VERSION);
if (currentVersion !== savedVersion) {
if (savedVersion)
await AsyncStorage.setItem(LAST_APP_VERSION, savedVersion);
await AsyncStorage.setItem(CURRENT_APP_VERSION, currentVersion);
await StorageWrapper.setItem(LAST_APP_VERSION, savedVersion);
await StorageWrapper.setItem(CURRENT_APP_VERSION, currentVersion);
}

const lastVersion = await AsyncStorage.getItem(LAST_APP_VERSION);
const lastVersion = await StorageWrapper.getItem(LAST_APP_VERSION);
if (!lastVersion) {
if (existingUser) {
// Setting last version to first version if user exists and lastVersion does not, to simulate update
await AsyncStorage.setItem(LAST_APP_VERSION, '0.0.1');
await StorageWrapper.setItem(LAST_APP_VERSION, '0.0.1');
} else {
// Setting last version to current version so that it's not treated as an update
await AsyncStorage.setItem(LAST_APP_VERSION, currentVersion);
await StorageWrapper.setItem(LAST_APP_VERSION, currentVersion);
}
}
} catch (error) {
Expand Down Expand Up @@ -712,6 +713,10 @@ const App = ({ userLoggedIn }) => {
name={Routes.MODAL.NFT_AUTO_DETECTION_MODAL}
component={NFTAutoDetectionModal}
/>
<Stack.Screen
name={Routes.SHEET.ORIGIN_SPAM_MODAL}
component={OriginSpamModal}
/>
</Stack.Navigator>
);

Expand Down
Loading

0 comments on commit 3a57e13

Please sign in to comment.