Skip to content

Commit

Permalink
style: run format
Browse files Browse the repository at this point in the history
  • Loading branch information
Grégor Sternat committed Sep 29, 2024
1 parent b5ba851 commit 426b157
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 57 deletions.
72 changes: 27 additions & 45 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,58 +1,40 @@
<script setup lang="ts">
import VerticalNavbar from "./components/wallet/verticalNavbar.vue";
import transactions_container from "./components/transaction/transactions_container.vue";
import ERC from "./components/main/ERC/ERC.vue";
import { onMounted, ref, onUnmounted } from "vue";
import passwordPage from "./components/passwordPage.vue";
import HeaderMenu from "./components/wallet/headerMenu.vue"
import chainSwitcher from "./components/chainSwitcher.vue";
import { SwitchChain } from "./multichain";
import { useStore } from "vuex";
import VerticalNavbar from './components/wallet/verticalNavbar.vue'
import transactions_container from './components/transaction/transactions_container.vue'
import ERC from './components/main/ERC/ERC.vue'
import { onMounted, ref, onUnmounted } from 'vue'
import passwordPage from './components/passwordPage.vue'
import HeaderMenu from './components/wallet/headerMenu.vue'
import chainSwitcher from './components/chainSwitcher.vue'
import { SwitchChain } from './multichain'
import { useStore } from 'vuex'
const open = ref(false)
const store = useStore()
onMounted(() => {
let isOpen: string | null;
if (sessionStorage.getItem('lock-wallet') && store.state.password) {
isOpen = localStorage.getItem('open-wallet')
if (isOpen === 'true') {
open.value = true
}
} else {
isOpen = "false";
open.value = false
onMounted(() => {
let isOpen: string | null
if (sessionStorage.getItem('lock-wallet') && store.state.password) {
isOpen = localStorage.getItem('open-wallet')
if (isOpen === 'true') {
open.value = true
}
// const store = useStore()
// SwitchChain(store)
} else {
isOpen = 'false'
open.value = false
}
// const store = useStore()
// SwitchChain(store)
setInterval(checkOpen, 5000)
const handleVisibilityChange = () => {
if (document.hidden) {
if (sessionStorage.getItem('lock-wallet') === 'true') {
open.value = false;
localStorage.setItem('open-wallet', 'false');
store.dispatch('clearPassword')
}
const handleVisibilityChange = () => {
if (document.hidden) {
if (sessionStorage.getItem('lock-wallet') === 'true') {
open.value = false
localStorage.setItem('open-wallet', 'false')
store.dispatch('clearPassword')
}
};
document.addEventListener('visibilitychange', handleVisibilityChange);
onUnmounted(() => {
document.removeEventListener('visibilitychange', handleVisibilityChange);
});
})
function checkOpen() {
const isOpen = localStorage.getItem('open-wallet')
if (isOpen === 'true') {
open.value = true
} else {
open.value = false
localStorage.setItem('open-wallet', 'false')
store.dispatch('clearPassword')
}
}
Expand Down
23 changes: 11 additions & 12 deletions src/components/passwordPage.vue
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
<template>
<div id="password-page">
<img src="/img/PrettyMetaMask.png" alt="PrettyMetaMask Logo" class="logo">
<div v-if="havePassword">
<h1 class="title">Enter your Password</h1>
<input type="password" @keyup.enter="submitPassword" v-model="password" placeholder="Password" />
<button class="btn" @click="submitPassword">Enter</button>
</div>
<div v-else>
<h1 class="title">Create your Password</h1>
<input type="password" v-model="password" placeholder="Password" />
<button class="btn" @click="createPassword">Create</button>
</div>
<div id="password-page">
<img src="/img/PrettyMetaMask.png" alt="PrettyMetaMask Logo" class="logo" />
<div v-if="havePassword">
<h1 class="title">Enter your Password</h1>
<input
type="password"
@keyup.enter="submitPassword"
v-model="password"
placeholder="Password"
/>
<button class="btn" @click="submitPassword">Enter</button>
</div>
<div v-else>
<h1 class="title">Create your Password</h1>
Expand Down

0 comments on commit 426b157

Please sign in to comment.