Fix: copy option not working with newly created public-private key pair
This commit is contained in:
sairaj mote 2021-02-22 17:18:34 +05:30
parent 937bbda091
commit 1a81b0a108
4 changed files with 17 additions and 16 deletions

View File

@ -367,8 +367,8 @@ sm-button[variant=primary] {
display: grid; display: grid;
border-radius: 0.6rem; border-radius: 0.6rem;
width: 100%; width: 100%;
padding: 0 1.5rem;
height: 100%; height: 100%;
padding: 0 1.5rem;
align-items: center; align-items: center;
} }
#landing .logo-section { #landing .logo-section {
@ -409,6 +409,7 @@ sm-button[variant=primary] {
} }
#landing_page { #landing_page {
grid-template-rows: auto 1fr;
overflow-y: auto; overflow-y: auto;
background: rgba(var(--foreground-color), 1); background: rgba(var(--foreground-color), 1);
} }

2
css/main.min.css vendored

File diff suppressed because one or more lines are too long

View File

@ -317,8 +317,8 @@ sm-button[variant="primary"]{
display: grid; display: grid;
border-radius: 0.6rem; border-radius: 0.6rem;
width: 100%; width: 100%;
padding: 0 1.5rem;
height: 100%; height: 100%;
padding: 0 1.5rem;
align-items: center; align-items: center;
.logo-section{ .logo-section{
padding: 1.5rem; padding: 1.5rem;
@ -360,6 +360,7 @@ sm-button[variant="primary"]{
} }
} }
#landing_page{ #landing_page{
grid-template-rows: auto 1fr;
overflow-y: auto; overflow-y: auto;
background: rgba(var(--foreground-color), 1); background: rgba(var(--foreground-color), 1);
} }

View File

@ -95,7 +95,7 @@
<h5>Private key (Password)</h5> <h5>Private key (Password)</h5>
<div class="copy-row"> <div class="copy-row">
<h4 id="generated_key" class="copy"></h4> <h4 id="generated_key" class="copy"></h4>
<svg class="icon" onclick="copyToClipboard('this, Copied private key')" viewBox="0 0 64 64"> <svg class="icon" onclick="copyToClipboard(this, 'Copied private key')" viewBox="0 0 64 64">
<title>Copy</title> <title>Copy</title>
<rect x="16" y="16" width="48" height="48" rx="6" /> <rect x="16" y="16" width="48" height="48" rx="6" />
<path d="M.5,47.52V6.5a6,6,0,0,1,6-6h41"/> <path d="M.5,47.52V6.5a6,6,0,0,1,6-6h41"/>
@ -352,7 +352,7 @@
<h5 class="label">Settings</h5> <h5 class="label">Settings</h5>
</div> </div>
</nav> </nav>
<section id="chat_page" class="grid"> <section id="chat_page" class="sub-page grid">
<div id="contacts" class="grid"> <div id="contacts" class="grid">
<header class="grid header"> <header class="grid header">
<div class="flex align-center"> <div class="flex align-center">
@ -557,7 +557,7 @@
</div> </div>
</div> </div>
</section> </section>
<section class="grid hide-completely" id="mail_page"> <section class="sub-page grid hide-completely" id="mail_page">
<div id="mails" class="grid"> <div id="mails" class="grid">
<header class="grid header"> <header class="grid header">
<div class="flex align-center"> <div class="flex align-center">
@ -607,7 +607,7 @@
</div> </div>
</div> </div>
</section> </section>
<section id="settings_page" class="hide-completely"> <section id="settings_page" class="sub-page hide-completely">
<aside id="settings_sidebar"> <aside id="settings_sidebar">
<header class="grid header"> <header class="grid header">
<div class="flex align-center"> <div class="flex align-center">
@ -1397,14 +1397,11 @@
} }
async function loadPage(){ async function loadPage(){
if(location.hash === ''){ if(location.hash === ''){
if(history.length === 2) history.pushState({type: 'subpage', id: 'chat_page'}, null, '#chat_page')
history.pushState({type: 'page', id: 'homepage'}, null, '') showPage('chat_page', true)
showPage('homepage')
} }
else{ else{
if(history.length === 2) showPage(location.hash.split('#')[1], true)
history.pushState({type: 'page', id: 'article_page', articleId: location.hash.slice(1)}, null, ``)
renderArticle(location.hash.slice(1))
} }
} }
function debounce(func, wait, immediate) { function debounce(func, wait, immediate) {
@ -1452,6 +1449,7 @@
</script> </script>
<script id="onLoadStartUp"> <script id="onLoadStartUp">
function onLoadStartUp() { function onLoadStartUp() {
document.body.classList.remove('hide-completely') document.body.classList.remove('hide-completely')
isPinSet = false; isPinSet = false;
@ -1511,7 +1509,7 @@
.then(r => console.log(r)) .then(r => console.log(r))
console.log(`Load Successful!`) console.log(`Load Successful!`)
if(isPinSet){ if(isPinSet){
showPage('chat_page', true) loadPage()
} }
}).catch(error => { }).catch(error => {
//console.error(`Failed to load data`) //console.error(`Failed to load data`)
@ -1879,8 +1877,7 @@
document.title = `New message(s)` document.title = `New message(s)`
} }
if(Object.keys(data.mails).length && activePage.button !== getRef('mail_page_button')){ if(Object.keys(data.mails).length && activePage.button !== getRef('mail_page_button')){
getRef('mail_page_button').setAttribute('data-notifications', Object.keys(data.mails).length) document.title = `New mail(s)`
notify(`${Object.keys(data.mails).length} new mail(s)`)
} }
} }
@ -3442,6 +3439,8 @@
function showPage(targetPage, subpage){ function showPage(targetPage, subpage){
if(subpage){ if(subpage){
document.querySelectorAll('.sub-page').forEach(page => page.classList.add('hide-completely'))
document.querySelectorAll(`.navbar-item`).forEach(item => item.classList.remove('active'))
const targetButton = document.querySelector(`.navbar-item[data-target="${targetPage}"]`) const targetButton = document.querySelector(`.navbar-item[data-target="${targetPage}"]`)
targetButton.classList.add('active') targetButton.classList.add('active')
if(activePage.page){ if(activePage.page){