Skip to content

Commit

Permalink
warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nsjames committed Jan 24, 2019
1 parent ef2248e commit a63cafa
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "scatter",
"version": "10.1.1",
"version": "10.1.2",
"description": "Scatter Desktop Companion",
"private": true,
"main": "electron.js",
Expand Down
15 changes: 14 additions & 1 deletion src/styles/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,19 @@ p {
margin:0;
}




.dangertip {
max-width:200px;
background:$red-gradient;
color:#fff;
box-shadow:0 1px 3px rgba(0,0,0,0.1), 0 8px 16px rgba(0,0,0,0.15);
border:1px solid rgba(0,0,0,0.2);
padding:10px;
font-size: 14px;
}

.full-panel {
min-height:calc(100vh - 80px);
width:100%;
Expand Down Expand Up @@ -645,7 +658,7 @@ label {
}

.wiggle {
animation: wiggle 0.3s ease infinite;
animation: wiggle 0.5s ease infinite;
}

@keyframes wiggle {
Expand Down
54 changes: 51 additions & 3 deletions src/views/popouts/Signature.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
</span>
</section>
</section>

<section class="participants top-less" v-if="isArbitrarySignature">
<label>{{locale(langKeys.POPOUTS.SIGNATURE.KeysInvolved)}}</label>
<section class="participant">{{arbitraryKeypair.name}} -- {{payload.publicKey.substr(0,6)}}.....{{payload.publicKey.substr(payload.publicKey.length - 5)}}</section>
Expand All @@ -29,8 +30,12 @@
<p>{{locale(langKeys.POPOUTS.SIGNATURE.ArbitraryDisabledDesc)}}</p>
</section>

<section v-if="isDangerous" class="disclaimer less-pad red centered" style="margin-bottom:10px;">
One of the actions included within this transaction is <b>dangerous</b>.
</section>

<!-- ACCEPT TRANSACTION -->
<btn blue="1" v-if="!pinning"
<btn :blue="!isDangerous" :red="isDangerous" big="1" v-if="!pinning"
:disabled="!isValidIdentity || cannotSignArbitrary"
:text="locale(langKeys.GENERIC.Allow)"
v-on:clicked="accepted" />
Expand All @@ -39,7 +44,7 @@
<btn :text="locale(langKeys.GENERIC.Deny)" v-if="!pinning"
v-on:clicked="returnResult(false)" />

<section v-if="!isArbitrarySignature">
<section v-if="!isArbitrarySignature && !isDangerous">
<br>
<br>
<label style="text-align:center;">{{locale(langKeys.POPOUTS.SIGNATURE.WhitelistDesc)}}</label>
Expand Down Expand Up @@ -77,7 +82,8 @@
v-on:locationField="(key, val) => clonedLocation[key] = val"
v-on:personalField="(key, val) => selectedIdentity.personal[key] = val" />

<section class="messages" :ref="`message_${index}`" v-for="(message, index) in messages">
<section class="messages" :class="{'dangerous':isDangerous}" :ref="`message_${index}`" v-for="(message, index) in messages">


<section class="whitelist-overlay" v-if="isPreviouslyWhitelisted(message)">
<section class="box">
Expand All @@ -88,6 +94,11 @@
<section :class="{'previous-whitelist':isPreviouslyWhitelisted(message)}">

<section class="details contract-action">

<section class="danger wiggle" v-if="isDangerous" v-tooltip.right="{content:isDangerous, classes:['dangertip']}">
<i class="icon-help"></i>
</section>

<figure class="title">
<input v-if="whitelisted && !isPreviouslyWhitelisted(message)"
:checked="!!getWhitelist(message)"
Expand All @@ -96,6 +107,7 @@

<span @click="collapse(message)">{{message.code}} <i class="contract-split icon-right-open-big"></i> {{message.type}}</span>
</figure>
<span class="danger-title" v-if="isDangerous">This action is <b>dangerous</b>!</span>
</section>

<section v-if="!isCollapsed(message)">
Expand Down Expand Up @@ -250,6 +262,12 @@
cannotSignArbitrary(){
if(!this.isArbitrarySignature) return false;
return this.payload.messages[0].data.signing.split(' ').some(x => x.length > 12);
},
isDangerous(){
if(this.messages.find(x => x.code === 'eosio' && x.type === 'updateauth')){
return `This action is dangerous. Accepting it will change your keys and possibly give your account to someone else. <br><br><b>Check to make sure the keys are correct.</b>`;
}
return false;
}
},
methods: {
Expand Down Expand Up @@ -529,6 +547,36 @@
}
}
}
&.dangerous {
.danger {
cursor: pointer;
float:left;
padding:6px 5px 5px;
background:rgba(0,0,0,0.1);
box-shadow:inset 0 5px 10px rgba(0,0,0,0.1);
text-shadow:0 2px 0 rgba(0,0,0,0.1);
border-radius:4px;
margin-top:7px;
margin-right:10px;
}
.details {
&.contract-action {
background:red;
background:$red-gradient;
border-bottom:1px solid darkred;
color:#fff;
}
}
.danger-title {
font-size: 11px;
width:100%;
}
}
}
.json-formatter-dark.json-formatter-row {
Expand Down

0 comments on commit a63cafa

Please sign in to comment.