Skip to content

Commit 558833e

Browse files
authored
Merge pull request bitpay#4744 from matiu/bug/chrome-storage-detection
better nw / chrome storage detection
2 parents d027355 + 1f340cb commit 558833e

File tree

7 files changed

+33
-31
lines changed

7 files changed

+33
-31
lines changed

cordova/config.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version='1.0' encoding='utf-8'?>
22
<widget id="com.bitpay.copay"
3-
version="2.6.0"
4-
android-versionCode="116"
5-
ios-CFBundleVersion="2.6.0">
3+
version="2.7.0"
4+
android-versionCode="117"
5+
ios-CFBundleVersion="2.7.0">
66
<name>Copay</name>
77
<description>
88
A secure bitcoin wallet for friends and companies.

cordova/wp/Package.appxmanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest" xmlns:m3="http://schemas.microsoft.com/appx/2014/manifest" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest">
3-
<Identity Name="18C7659D.CopayWallet" Publisher="CN=F89609D1-EB3E-45FD-A58A-C2E3895FCE7B" Version="2.6.0.0" />
3+
<Identity Name="18C7659D.CopayWallet" Publisher="CN=F89609D1-EB3E-45FD-A58A-C2E3895FCE7B" Version="2.7.0.0" />
44
<mp:PhoneIdentity PhoneProductId="5381aa50-9069-11e4-84cc-293caf9cbdc8" PhonePublisherId="F89609D1-EB3E-45FD-A58A-C2E3895FCE7B" />
55
<Properties>
66
<DisplayName>Copay Bitcoin Wallet</DisplayName>

cordova/wp/Properties/WMAppManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<Language code="pl" />
1212
<Language code="cs" />
1313
</Languages>
14-
<App Author="Bitpay Inc." BitsPerPixel="32" Description="A multisignature Bitcoin Wallet" Genre="apps.normal" ProductID="{5381aa50-9069-11e4-84cc-293caf9cbdc8}" Publisher="Copay Bitcoin Wallet" PublisherID="{31cdd08b-457c-413d-b440-f6665eec847d}" RuntimeType="Silverlight" Title="Copay Bitcoin Wallet" Version="2.6.0.0" xmlns="" NotificationService="MPN">
14+
<App Author="Bitpay Inc." BitsPerPixel="32" Description="A multisignature Bitcoin Wallet" Genre="apps.normal" ProductID="{5381aa50-9069-11e4-84cc-293caf9cbdc8}" Publisher="Copay Bitcoin Wallet" PublisherID="{31cdd08b-457c-413d-b440-f6665eec847d}" RuntimeType="Silverlight" Title="Copay Bitcoin Wallet" Version="2.7.0.0" xmlns="" NotificationService="MPN">
1515
<IconPath IsRelative="true" IsResource="false">Assets\[email protected]</IconPath>
1616
<Capabilities>
1717
<Capability Name="ID_CAP_WEBBROWSERCOMPONENT" />

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"name": "copay",
33
"description": "A multisignature bitcoin wallet",
44
"author": "BitPay",
5-
"version": "2.6.0",
6-
"androidVersionCode": "116",
5+
"version": "2.7.0",
6+
"androidVersionCode": "117",
77
"keywords": [
88
"wallet",
99
"copay",

src/js/services/localStorage.js

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -67,33 +67,35 @@ angular.module('copayApp.services')
6767

6868

6969
if (isNW) {
70-
$log.info('Overwritting localstorage with chrome storage for NW.JS');
70+
$log.info('Using chrome storage for NW.JS');
7171

7272
var ts = ls.getItem('migrationToChromeStorage');
7373
var p = ls.getItem('profile');
7474

75-
// Need migration?
76-
if (!ts && p) {
77-
$log.info('### MIGRATING DATA! TO CHROME STORAGE');
78-
79-
var j = 0;
80-
for (var i = 0; i < localStorage.length; i++) {
81-
var k = ls.key(i);
82-
var v = ls.getItem(k);
83-
84-
$log.debug(' Key: ' + k);
85-
root.set(k, v, function() {
86-
j++;
87-
if (j == localStorage.length) {
88-
$log.info('### MIGRATION DONE');
89-
ls.setItem('migrationToChromeStorage', Date.now())
90-
ls = chrome.storage.local;
91-
}
92-
})
75+
root.get('profile', function(err, newP){
76+
// Need migration?
77+
if (!ts && !newP && p) {
78+
$log.info('### MIGRATING DATA! TO CHROME STORAGE');
79+
80+
var j = 0;
81+
for (var i = 0; i < localStorage.length; i++) {
82+
var k = ls.key(i);
83+
var v = ls.getItem(k);
84+
85+
$log.debug(' Key: ' + k);
86+
root.set(k, v, function() {
87+
j++;
88+
if (j == localStorage.length) {
89+
$log.info('### MIGRATION DONE');
90+
ls.setItem('migrationToChromeStorage', Date.now())
91+
ls = chrome.storage.local;
92+
}
93+
})
94+
}
95+
} else if (p) {
96+
$log.info('# Data already migrated to Chrome storage.' + (ts||''));
9397
}
94-
} else if (p) {
95-
$log.info('# Data already migrated to Chrome storage on ' + ts);
96-
}
98+
});
9799
}
98100

99101

webkitbuilds/.desktop

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[Desktop Entry]
22
Type=Application
3-
Version=2.6.0
3+
Version=2.7.0
44
Name=Copay
55
Comment=A multisignature wallet
66
Exec=copay

webkitbuilds/setup-win.iss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
33

44
#define MyAppName "Copay"
5-
#define MyAppVersion "2.6.0"
5+
#define MyAppVersion "2.7.0"
66
#define MyAppPublisher "BitPay"
77
#define MyAppURL "https://copay.io"
88
#define MyAppExeName "Copay.exe"

0 commit comments

Comments
 (0)