Skip to content

Commit a63cafa

Browse files
committed
warnings
1 parent ef2248e commit a63cafa

File tree

3 files changed

+66
-5
lines changed

3 files changed

+66
-5
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "scatter",
3-
"version": "10.1.1",
3+
"version": "10.1.2",
44
"description": "Scatter Desktop Companion",
55
"private": true,
66
"main": "electron.js",

src/styles/styles.scss

+14-1
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,19 @@ p {
160160
margin:0;
161161
}
162162

163+
164+
165+
166+
.dangertip {
167+
max-width:200px;
168+
background:$red-gradient;
169+
color:#fff;
170+
box-shadow:0 1px 3px rgba(0,0,0,0.1), 0 8px 16px rgba(0,0,0,0.15);
171+
border:1px solid rgba(0,0,0,0.2);
172+
padding:10px;
173+
font-size: 14px;
174+
}
175+
163176
.full-panel {
164177
min-height:calc(100vh - 80px);
165178
width:100%;
@@ -645,7 +658,7 @@ label {
645658
}
646659

647660
.wiggle {
648-
animation: wiggle 0.3s ease infinite;
661+
animation: wiggle 0.5s ease infinite;
649662
}
650663

651664
@keyframes wiggle {

src/views/popouts/Signature.vue

+51-3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
</span>
1818
</section>
1919
</section>
20+
2021
<section class="participants top-less" v-if="isArbitrarySignature">
2122
<label>{{locale(langKeys.POPOUTS.SIGNATURE.KeysInvolved)}}</label>
2223
<section class="participant">{{arbitraryKeypair.name}} -- {{payload.publicKey.substr(0,6)}}.....{{payload.publicKey.substr(payload.publicKey.length - 5)}}</section>
@@ -29,8 +30,12 @@
2930
<p>{{locale(langKeys.POPOUTS.SIGNATURE.ArbitraryDisabledDesc)}}</p>
3031
</section>
3132

33+
<section v-if="isDangerous" class="disclaimer less-pad red centered" style="margin-bottom:10px;">
34+
One of the actions included within this transaction is <b>dangerous</b>.
35+
</section>
36+
3237
<!-- ACCEPT TRANSACTION -->
33-
<btn blue="1" v-if="!pinning"
38+
<btn :blue="!isDangerous" :red="isDangerous" big="1" v-if="!pinning"
3439
:disabled="!isValidIdentity || cannotSignArbitrary"
3540
:text="locale(langKeys.GENERIC.Allow)"
3641
v-on:clicked="accepted" />
@@ -39,7 +44,7 @@
3944
<btn :text="locale(langKeys.GENERIC.Deny)" v-if="!pinning"
4045
v-on:clicked="returnResult(false)" />
4146

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

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

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

9096
<section class="details contract-action">
97+
98+
<section class="danger wiggle" v-if="isDangerous" v-tooltip.right="{content:isDangerous, classes:['dangertip']}">
99+
<i class="icon-help"></i>
100+
</section>
101+
91102
<figure class="title">
92103
<input v-if="whitelisted && !isPreviouslyWhitelisted(message)"
93104
:checked="!!getWhitelist(message)"
@@ -96,6 +107,7 @@
96107

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

101113
<section v-if="!isCollapsed(message)">
@@ -250,6 +262,12 @@
250262
cannotSignArbitrary(){
251263
if(!this.isArbitrarySignature) return false;
252264
return this.payload.messages[0].data.signing.split(' ').some(x => x.length > 12);
265+
},
266+
isDangerous(){
267+
if(this.messages.find(x => x.code === 'eosio' && x.type === 'updateauth')){
268+
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>`;
269+
}
270+
return false;
253271
}
254272
},
255273
methods: {
@@ -529,6 +547,36 @@
529547
}
530548
}
531549
}
550+
551+
&.dangerous {
552+
553+
.danger {
554+
cursor: pointer;
555+
float:left;
556+
padding:6px 5px 5px;
557+
background:rgba(0,0,0,0.1);
558+
box-shadow:inset 0 5px 10px rgba(0,0,0,0.1);
559+
text-shadow:0 2px 0 rgba(0,0,0,0.1);
560+
border-radius:4px;
561+
margin-top:7px;
562+
margin-right:10px;
563+
564+
}
565+
566+
.details {
567+
&.contract-action {
568+
background:red;
569+
background:$red-gradient;
570+
border-bottom:1px solid darkred;
571+
color:#fff;
572+
}
573+
}
574+
575+
.danger-title {
576+
font-size: 11px;
577+
width:100%;
578+
}
579+
}
532580
}
533581
534582
.json-formatter-dark.json-formatter-row {

0 commit comments

Comments
 (0)