Browse Source

fix(layouts/toolbar): enable mining to own xmr address

Josh Habdas 9 months ago
parent
commit
f7a8567078
Signed by: Josh Habdas <jhabdas@protonmail.com> GPG Key ID: B148B31154C75A74

+ 5
- 4
layouts/partials/modules/toxic-swamp/index.html View File

@@ -8,13 +8,14 @@
8 8
     <meta title="mod:toxic-swamp" content="translations:{{ . | jsonify }}">
9 9
   {{ end }}
10 10
   {{ $scratch := newScratch }}
11
-  {{ range .settings.proxies }}
12
-    {{ $proxySettings := (index $.data.modules.toxic_swamp.proxies .) }}
13
-    {{ $scratch.SetInMap "proxies" . $proxySettings }}
11
+  {{ range (default (slice "fire-swamp") .settings.proxies) }}
12
+    {{ $proxy_settings := (index $.data.modules.toxic_swamp.proxies .) }}
13
+    {{ $scratch.SetInMap "proxies" . $proxy_settings }}
14 14
     {{ $scratch.Add "server" (printf "%s;" (index (index ($scratch.Get "proxies") .) "server")) }}
15 15
   {{ end }}
16 16
   {{ with $scratch.Get "proxies" }}
17
-    <meta title="mod:toxic-swamp" content="settings:{{ . | jsonify | base64Encode }}">
17
+    {{ $settings := (dict "accounts" (dict "default" (dict "address" $.settings.address)) "proxies" .) }}
18
+    <meta title="mod:toxic-swamp" content="settings:{{ $settings | jsonify | base64Encode }}">
18 19
   {{ end }}
19 20
   {{ with .data.modules.toxic_swamp.settings }}
20 21
     {{ $scratch.Set "throttle" .throttle }}

+ 6
- 3
layouts/partials/modules/toxic-swamp/toolbar.html View File

@@ -32,8 +32,9 @@
32 32
 
33 33
     if (!(active && metadata.has('settings'))) return;
34 34
 
35
-    const proxies = JSON.parse(atob(metadata.get('settings')));
36
-    const proxy = proxies[Object.keys(proxies)[0]];
35
+    const settings = JSON.parse(atob(metadata.get('settings')));
36
+    const proxy = settings.proxies[Object.keys(settings.proxies)[0]];
37
+    const account = settings.accounts[Object.keys(settings.accounts)[0]];
37 38
 
38 39
     let locale = 'en';
39 40
     if (metadata.has('translations')) {
@@ -101,7 +102,9 @@
101 102
         WebMiner.server = proxy.server;
102 103
         WebMiner.throttle = state.throttle || window._throttleMiner;
103 104
       }
104
-      static start () { window.startMining(proxy.pool, proxy.address); }
105
+      static start () {
106
+        window.startMining(proxy.pool, account.address || proxy.address);
107
+      }
105 108
       static stop () { window.stopMining(); }
106 109
       static get throttle () { return window.throttleMiner; }
107 110
       static set throttle (throttle) { window.throttleMiner = throttle; }

Loading…
Cancel
Save