forked from PIVX-Labs/MyPIVXWallet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement app versioning, changelog & update popup (PIVX-Labs#139)
* Implement app versioning, changelog & update popup * Update changelog * Remove weird merge duplicate
- Loading branch information
Showing
8 changed files
with
142 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# New Features | ||
- PIVX Promos: Create or Redeem on-chain gift codes. | ||
- Dashboard Activity: Detailed transaction history. | ||
- New Database: With modern features and scalability. | ||
- Per-update changelog: You're reading it right now! | ||
|
||
# Improvements | ||
- New Settings screen design, sleek and intuitive. | ||
- New Explorer: explorer.duddino.com. | ||
|
||
# Bug Fixes | ||
- Fixed VanityGen from failing. | ||
- Fixed CoinGecko API spam, reducing ratelimits. | ||
- Fixed potential XSS vulnerabilities. | ||
- Fixed Masternodes being loaded from the wrong DB. | ||
- Fixed Activity failing to load on Shield Txs. | ||
- Fixed black screens on Payment Request URLs. | ||
- Fixed Payment Request info staying post-payment. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import { doms } from './global'; | ||
import { confirmPopup, sanitizeHTML } from './misc'; | ||
|
||
// ESLint error-skipping for webpack-injected globals | ||
/* global VERSION */ | ||
/* global CHANGELOG */ | ||
|
||
/** | ||
* Check for recent local app updates | ||
*/ | ||
export function checkForUpgrades() { | ||
// Check if the last used version doesn't match the current version. | ||
// Note: it's intended to skip if `lastVersion` is null, as this stops the popups for NEW users. | ||
const lastVersion = localStorage.getItem('version'); | ||
if (lastVersion && lastVersion !== VERSION) { | ||
// Old user's first time on this update; display the changelog | ||
renderChangelog(); | ||
} | ||
|
||
// Update the footer with our version | ||
doms.domVersion.innerText = 'v' + VERSION; | ||
|
||
// Update the last-used app version | ||
localStorage.setItem('version', VERSION); | ||
} | ||
|
||
/** | ||
* Render the Changelog from app versioning data, displaying it to the user | ||
*/ | ||
export function renderChangelog() { | ||
let strHTML = ''; | ||
|
||
// Loop every line of the markdown | ||
for (const rawLine of CHANGELOG.split(/\r?\n/)) { | ||
// Skip empty lines with linebreaks | ||
if (!rawLine.trim()) { | ||
strHTML += '<br><br>'; | ||
continue; | ||
} | ||
|
||
// Parse the element type and the line content | ||
const type = rawLine[0]; | ||
const line = rawLine.substring(1).trim(); | ||
|
||
switch (type) { | ||
case '#': | ||
// `#` is a header, for titles like "New Features" or "Bug Fixes" | ||
strHTML += `<h3>${sanitizeHTML(line)}</h3>`; | ||
break; | ||
case '-': | ||
// `-` is a list element, for each 'New Feature' or 'Bug Fix' to be listed with | ||
strHTML += `<p>- ${sanitizeHTML(line)}</p>`; | ||
break; | ||
default: | ||
// If no element was recognised, it's just a plaintext line | ||
strHTML += `<p>${sanitizeHTML(type + line)}</p>`; | ||
break; | ||
} | ||
} | ||
|
||
// Enclose the Changelog in a body with a Changelog class | ||
const strFinalHTML = `<div class="changelog">${strHTML}</div>`; | ||
|
||
confirmPopup({ | ||
title: "What's New in " + VERSION + '?', | ||
html: strFinalHTML, | ||
resolvePromise: false, | ||
hideConfirm: true, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters