Skip to content

Commit

Permalink
chore: update text (#575)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vid201 committed Mar 5, 2024
1 parent 31561a2 commit c82cd32
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions packages/dapp/src/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@
"delete-error": "Failed to delete backup",
"delete-google": "Delete from Google Drive",
"delete-success": "Successfully deleted backup",
"disable-popups": "Disable Pop-ups",
"disable-popups": "Disable Popups",
"export": "Export",
"export-desc": "Export encrypted Masca backup to a file.",
"export-error": "Failed to export backup",
Expand All @@ -535,7 +535,7 @@
"import-success": "Successfully imported backup",
"not-implemented": "Not implemented yet",
"popups": "Permissions",
"popups-desc": "Disabling pop-ups is very dangerous. We recommend setting trusted dapps instead!",
"popups-desc": "Disabling popups is very dangerous. We recommend setting trusted dapps instead!",
"title": "Settings",
"unknown-error": "Unknown error",
"wallet-error": "Failed to get wallet ID"
Expand Down
4 changes: 2 additions & 2 deletions packages/docs/docs/integrate-masca/masca-connector.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,9 @@ const vpRes = await api.verifyData({ presentation: VP, verbose: true });

## Snap Settings

`togglePopups` is used to enable/disable the `"Are you sure?"` alerts on any dapp. Pop-ups are enabled by default for user to approve every action.
`togglePopups` is used to enable/disable the `"Are you sure?"` alerts on any dapp. Popups are enabled by default for user to approve every action.

`addTrustedDapp` is used to add a dapp to the list of trusted dapps. Pop-ups do not appear on trusted dapps. This method can be called to add ANY dapp ONLY ON `masca.io`. On any other dapp origin is set automatically (You can only add dapp X on dapp X). Input is a hostname of a dapp
`addTrustedDapp` is used to add a dapp to the list of trusted dapps. Popups do not appear on trusted dapps. This method can be called to add ANY dapp ONLY ON `masca.io`. On any other dapp origin is set automatically (You can only add dapp X on dapp X). Input is a hostname of a dapp

`removeTrustedDapp` is used to remove a dapp from the list of trusted dapps. This method can only remove dapps with the same origin (dApp X can only remove dapp X). Input is a hostname of a dapp

Expand Down
4 changes: 2 additions & 2 deletions packages/docs/docs/integrate-masca/rpc-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ We recommend calling this method in `window.ethereum.on('accountsChanged', handl

#### Description

`togglePopups` toggles pop-ups that show up whenever the user tries to save a VC, generate a VP, etc. Pop-ups are enabled by default to keep user in total control of their actions. With pop-ups disabled, a dapp can query user's credentials, etc. without them knowing. We recommend using `addTrustedDapp` instead to only trust specific dapps.
`togglePopups` toggles popups that show up whenever the user tries to save a VC, generate a VP, etc. Popups are enabled by default to keep user in total control of their actions. With popups disabled, a dapp can query user's credentials, etc. without them knowing. We recommend using `addTrustedDapp` instead to only trust specific dapps.

```typescript
const response = await ethereum.request({
Expand Down Expand Up @@ -562,7 +562,7 @@ const response = await ethereum.request({

#### Description

`addTrustedDapp` adds a dapp to the list of trusted dapps. Trusted dapps do not show pop-ups. Dapps (other than `masca.io`) can only add themselves to the list of trusted dapps. Note that `origin` needs to be a hostname (`masca.io`) and not a full URL (`https://masca.io`)
`addTrustedDapp` adds a dapp to the list of trusted dapps. Trusted dapps do not show popups. Dapps (other than `masca.io`) can only add themselves to the list of trusted dapps. Note that `origin` needs to be a hostname (`masca.io`) and not a full URL (`https://masca.io`)

```typescript
const response = await ethereum.request({
Expand Down
6 changes: 3 additions & 3 deletions packages/snap/src/General.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class GeneralService {
}): Promise<boolean> {
const state = StorageService.get();

// If the user rejects the pop-up, throw an error
// If the user rejects the popup, throw an error
if (
!(await UIService.changePermissionDialog({
permission: params.method,
Expand All @@ -134,7 +134,7 @@ class GeneralService {
throw new Error('User rejected permission change.');
}

// If the user accepts the pop-up, change the permission
// If the user accepts the popup, change the permission

if (permissionExists(params.originHostname, state)) {
state[CURRENT_STATE_VERSION].config.dApp.permissions[
Expand Down Expand Up @@ -195,7 +195,7 @@ class GeneralService {
state[CURRENT_STATE_VERSION].config.dApp.disablePopups = true;
return state[CURRENT_STATE_VERSION].config.dApp.disablePopups;
}
throw new Error('User rejected pop-up toggle.');
throw new Error('User rejected popup toggle.');
} else {
state[CURRENT_STATE_VERSION].config.dApp.disablePopups = false;
return state[CURRENT_STATE_VERSION].config.dApp.disablePopups;
Expand Down
8 changes: 4 additions & 4 deletions packages/snap/src/UI.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,9 @@ class UIService {

static async togglePopupsDialog() {
const uiPanel = panel([
heading('Toggle Pop-ups'),
heading('Toggle Popups'),
...this.originWrapper,
text('Would you like to turn off pop-ups?'),
text('Would you like to turn off popups?'),
divider(),
text(
'This can result in a better user experience, but you will not be able to see what the dapp is requesting.'
Expand Down Expand Up @@ -342,7 +342,7 @@ class UIService {
params: {
type: 'prompt',
content: panel([
heading('Enter the PIN you received from the issuer'),
heading('Enter the PIN you received from the issuer.'),
...this.originWrapper,
]),
placeholder: 'PIN...',
Expand Down Expand Up @@ -438,7 +438,7 @@ class UIService {
const uiPanel = panel([
heading('Change Permission'),
...this.originWrapper,
text('Would you to change the following permissions?'),
text('Would you to change the following permission?'),
divider(),
text(
`**${params.value ? 'Disable' : 'Enable'}** popups for **${
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/tests/e2e/addTrustedDapp.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ describe('addTrustedDapp', () => {
expect.assertions(1);
});

it('Should not show pop-up if the dapp is already in the list', async () => {
it('Should not show popup if the dapp is already in the list', async () => {
const spy = vi.spyOn(UIService, 'addTrustedDappDialog');

const defaultState = getDefaultSnapState(account);
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/tests/e2e/changePermission.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe('changePermission', () => {
expect.assertions(3);
});

it('should not show pop-up if the dapp is already in the list', async () => {
it('should not show popup if the dapp is already in the list', async () => {
const spyQuery = vi.spyOn(snapMock.rpcMocks, 'snap_dialog');

const defaultState = getDefaultSnapState(account);
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/tests/e2e/removeTrustedDapp.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ describe('removeTrustedDapp', () => {
expect.assertions(3);
});

it('Should show pop-up if the dapp is not in the list', async () => {
it('Should show popup if the dapp is not in the list', async () => {
const spy = vi.spyOn(UIService, 'queryAllDialog');

const defaultState = getDefaultSnapState(account);
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/tests/e2e/togglePopups.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('togglePopups', () => {
global.ethereum = snapMock as unknown as MetaMaskInpageProvider;
});

it('should enable pop-ups and then disable them', async () => {
it('should enable popups and then disable them', async () => {
const res = (await onRpcRequest({
origin: 'http://localhost',
request: {
Expand Down

0 comments on commit c82cd32

Please sign in to comment.