Skip to content

Commit

Permalink
Merge pull request #3433 from superhero-com/feature/hide-private-key-…
Browse files Browse the repository at this point in the history
…on-page-hidden

Do not show sensitive content if not authenticated
  • Loading branch information
CedrikNikita authored Dec 16, 2024
2 parents b14af72 + 4e8ecff commit b4b49ea
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/composables/modals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,13 @@ export function useModals() {
openModal(MODAL_ENABLE_BIOMETRIC_LOGIN);
}

function closeAllModals() {
modalsOpenRaw.value?.forEach(({ key }) => closeModalByKey(key));
}

return {
modalsOpen,
closeAllModals,
registerModal,
openModal,
openDefaultModal,
Expand Down
2 changes: 1 addition & 1 deletion src/popup/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ export default defineComponent({
.app-unauthenticated-placeholder {
position: absolute;
z-index: 2;
z-index: $z-index-placeholder;
inset: 0;
visibility: hidden;
opacity: 0;
Expand Down
3 changes: 3 additions & 0 deletions src/popup/components/Modals/PasswordLogin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,12 @@ export default defineComponent({
</script>

<style lang="scss" scoped>
@use '@/styles/variables' as *;
@use '@/styles/typography';
.password-login {
z-index: $z-index-login-modal;
.content-wrapper,
.password-login-form {
display: flex;
Expand Down
5 changes: 5 additions & 0 deletions src/popup/components/Modals/ResetWalletModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ import { IS_MOBILE_APP } from '@/constants';
import {
useAccounts,
useAeSdk,
useModals,
useNetworks,
usePermissions,
useUi,
Expand Down Expand Up @@ -95,13 +96,15 @@ export default defineComponent({
const { resetUiSettings } = useUi();
const { disconnectDapps } = useAeSdk();
const { resetPermissions } = usePermissions();
const { closeAllModals } = useModals();
async function onReset() {
resetAccounts();
resetNetworks();
resetUiSettings();
disconnectDapps();
resetPermissions();
closeAllModals();
WalletStorage.clear();
if (IS_MOBILE_APP) {
Expand Down Expand Up @@ -129,6 +132,8 @@ export default defineComponent({
@use '@/styles/variables' as *;
.reset-wallet {
z-index: $z-index-login-modal;
.icon-wrapper {
margin: 8px auto 18px;
color: $color-danger;
Expand Down
2 changes: 2 additions & 0 deletions src/styles/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ $font-mono: 'IBM Plex Mono';

$z-index-header: 2;
$z-index-modal: $z-index-header + 2;
$z-index-placeholder: $z-index-modal + 1;
$z-index-login-modal: $z-index-placeholder + 1;
$z-index-loader: $z-index-modal - 1; // Modals should always be above the loader
$z-index-back-to-top: $z-index-modal + 1;

Expand Down

0 comments on commit b4b49ea

Please sign in to comment.