Skip to content

Commit

Permalink
refactor: apps browser props validation
Browse files Browse the repository at this point in the history
  • Loading branch information
martinkaintas committed Mar 1, 2024
1 parent 75a8c46 commit df03451
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/popup/components/AppsBrowser/AppsBrowserHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ export default defineComponent({
AccountSelector,
},
props: {
selectedApp: { type: Object, required: true },
iframe: { type: Object, required: true },
selectedApp: { type: Object, default: null },
iframe: { type: Object, default: null },
},
emits: ['back', 'refresh'],
setup(props, { emit }) {
Expand All @@ -111,10 +111,10 @@ export default defineComponent({
? homeRouteName.value
: ROUTE_INDEX,
);
const isSecure = computed(() => props.selectedApp.url.startsWith('https://'));
const isSecure = computed(() => props?.selectedApp?.url.startsWith('https://'));
const selectedAppHost = computed(() => {
const url = new URL(props.selectedApp.url);
return url.host;
const url = new URL(props?.selectedApp?.url);
return url?.host;
});
const accountAddress = ref(unref(activeAccount.value.address));
Expand All @@ -137,7 +137,7 @@ export default defineComponent({
const value = await openModal(MODAL_DAPP_BROWSER_ACTIONS,
{
iframe: props.iframe,
selectedApp: props.selectedApp,
selectedApp: props?.selectedApp,
});
if (value?.action === BROWSER_ACTIONS.refresh) {
emit('refresh');
Expand Down
2 changes: 1 addition & 1 deletion src/popup/components/Modals/WarningDappBrowser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
{{ $t('pages.warningDappBrowser.decline') }}
</BtnMain>
<BtnMain
variant="light"
variant="primary"
@click="confirm"
>
{{ $t('common.confirm') }}
Expand Down

0 comments on commit df03451

Please sign in to comment.