Skip to content

WIP: major overhaul to miner/vault overlays + handling of tokens #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

calebjclark
Copy link
Contributor

  • The flow to create a new miner is undergoing a major overhaul. The first overlay screen is laid out but not fully implemented.
  • The create a vault overlay has been laid out but not fully implemented. It follows the same flow as creating a miner.
  • Commander now uses microgons and micronots for storing tokens. It only converts to argons in UI display.

if (this._value > max) {
this._value = max;
if (format.includes('%')) {
format = format.replace('%', '+%');

Check failure

Code scanning / CodeQL

Incomplete string escaping or encoding High

This replaces only the first occurrence of '%'.

Copilot Autofix

AI 12 days ago

To fix the issue, the replace method should be updated to use a regular expression with the global (g) flag. This ensures that all occurrences of the % character in the format string are replaced, not just the first one. Specifically, the string '%' should be replaced with the regular expression /\%/g. This change will ensure that the code behaves correctly even if the format string contains multiple % characters.


Suggested changeset 1
src-vue/lib/numeral.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/src-vue/lib/numeral.ts b/src-vue/lib/numeral.ts
--- a/src-vue/lib/numeral.ts
+++ b/src-vue/lib/numeral.ts
@@ -34,3 +34,3 @@
     if (format.includes('%')) {
-      format = format.replace('%', '+%');
+      format = format.replace(/%/g, '+%');
     } else {
EOF
@@ -34,3 +34,3 @@
if (format.includes('%')) {
format = format.replace('%', '+%');
format = format.replace(/%/g, '+%');
} else {
Copilot is powered by AI and may make mistakes. Always verify output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants