Skip to content

Commit 6da44b5

Browse files
committed
update
1 parent 5727401 commit 6da44b5

File tree

5 files changed

+90
-79
lines changed

5 files changed

+90
-79
lines changed

lib/controllers/stringcontroller.dart

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -139,30 +139,30 @@ class StrController extends GetxController {
139139
var openPluginManagerStr = 'Open Plugin Manager'.obs;
140140
var loadPluginStr = 'Load Plugin'.obs;
141141
var zerohelloSiteDesStr = 'Say Hello to ZeroNet, a Dashboard to manage '
142-
'all your ZeroNet Z(S)ites, You can view feed of other zites like '
143-
'posts, comments of other users from ZeroTalk as well for your posts '
144-
'and Stats like Total Requests sent and received from other peers on ZeroNet. '
142+
'all your ZeroNetX Z(S)ites, You can view feed of other zites like '
143+
'posts, comments of other users from ThreadIt as well for your posts '
144+
'and Stats like Total Requests sent and received from other peers on ZeroNetX. '
145145
'You can also pause, clone or favourite, delete Zites from single page.'
146146
.obs;
147-
var zeronetMobileSiteDesStr = 'Forum to report ZeroNet Mobile app issues. '
147+
var zeronetMobileSiteDesStr = 'Forum to report ZeroNetX app issues. '
148148
'Want a new feature in the app, Request a Feature. '
149149
'Facing any Bugs while using the app ? '
150150
'Just report problem here, we will take care of it. '
151151
'Want to Discuss any topic about app development ? '
152152
'Just dive into to this Zite.'
153153
.obs;
154154
var zeroTalkSiteDesStr = 'Need a forum to discuss something, '
155-
'we got covered you here. ZeroTalk fits your need, '
155+
'we got covered you here. ThreadIt fits your need, '
156156
'just post something to get opinion from others on Network. '
157157
'Have some queries ? don\'t hesitate to ask here.'
158158
'Tired of Spam ? Who don\'t! You can mute individual users also.'
159159
.obs;
160160
var zeroblogSiteDesStr = 'Want to Know Where ZeroNet is Going ? '
161-
'ZeroBlog gives you latest changes and improvements '
162-
'made to ZeroNet, including Bug Fixes, '
163-
'Speed Improvements of ZeroNet Core Software. '
161+
'Scribe gives you latest changes and improvements '
162+
'made to ZeroNetX, including Bug Fixes, '
163+
'Speed Improvements of ZeroNetX Core Software. '
164164
'Also Provides varies links to ZeroNet Protocol and '
165-
'how ZeroNet works underhood and much more things to know.'
165+
'how ZeroNetX works underhood and much more things to know.'
166166
.obs;
167167
var zeromailSiteDesStr = 'So you need a mail service, use ZeroMail, '
168168
'fully end-to-end encrypted mail service on ZeroNet, '

lib/others/constants.dart

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ class Utils {
117117
static const String urlZeroNetMob = '15UYrA7aXr2Nto1Gg4yWXpY3EAJwafMTNk';
118118
static const String urlTalk = 'Talk.ZeroNetwork.bit';
119119
static const String btcUrlTalk = '1TaLkFrMwvbNsooF4ioKAY9EuxTBTjipT';
120-
static const String urlBlog = 'Blog.ZeroNetwork.bit';
121-
static const String btcUrlBlog = '1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8';
120+
static const String urlBlog = '1SCribeHs1nz8m3vXipP84oyXUy4nf2ZD';
121+
static const String btcUrlBlog = '1SCribeHs1nz8m3vXipP84oyXUy4nf2ZD';
122122
static const String urlMail = 'Mail.ZeroNetwork.bit';
123123
static const String btcUrlMail = '1MaiL5gfBM1cyb4a8e3iiL8L5gXmoAJu27';
124124
static const String urlMe = 'Me.ZeroNetwork.bit';
@@ -137,6 +137,11 @@ class Utils {
137137
'url': urlZeroNetMob,
138138
'btcAddress': urlZeroNetMob,
139139
},
140+
'Scribe': {
141+
'description': strController.zeroblogSiteDesStr.value,
142+
'url': urlBlog,
143+
'btcAddress': btcUrlBlog,
144+
},
140145
'ZeroMe': {
141146
'description': strController.zeromeSiteDesStr.value,
142147
'url': urlMe,
@@ -147,21 +152,11 @@ class Utils {
147152
'url': urlSites,
148153
'btcAddress': btcUrlSites,
149154
},
150-
'ZeroBlog': {
151-
'description': strController.zeroblogSiteDesStr.value,
152-
'url': urlBlog,
153-
'btcAddress': btcUrlBlog,
154-
},
155155
'ZeroMail': {
156156
'description': strController.zeromailSiteDesStr.value,
157157
'url': urlMail,
158158
'btcAddress': btcUrlMail,
159159
},
160-
// 'ZeroTalk': {
161-
// 'description': strController.zeroTalkSiteDesStr.value,
162-
// 'url': urlTalk,
163-
// 'btcAddress': btcUrlTalk,
164-
// },
165160
};
166161

167162
// 'ZeroName': '1Name2NXVi1RDPDgf5617UoW7xA6YrhM9F',

lib/others/utils.dart

Lines changed: 66 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -118,33 +118,35 @@ bindUnZipIsolate() {
118118
bindUnZipIsolate();
119119
return;
120120
}
121-
unZipIsolateBound = true;
122-
_unZipPort.listen((data) {
123-
String name = data[0];
124-
int currentFile = data[1];
125-
int totalFiles = data[2];
126-
var percent = (currentFile / totalFiles) * 100;
127-
if (percent.toInt() % 5 == 0) {
128-
varStore.setLoadingStatus('${strController.installingStr.value} $name');
129-
varStore.setLoadingPercent(percent.toInt());
130-
}
131-
if (percent == 100) {
132-
percentUnZip = percentUnZip + 100;
133-
}
134-
var nooffiles = files(arch).length;
135-
if (percentUnZip == nooffiles * 100) {
136-
if (requiresPatching()) {
137-
var patchFile = File(dataDir + '/$buildNumber.patched');
138-
if (!patchFile.existsSync()) {
139-
patchFile.createSync(recursive: true);
121+
if (!unZipIsolateBound) {
122+
unZipIsolateBound = true;
123+
_unZipPort.listen((data) {
124+
String name = data[0];
125+
int currentFile = data[1];
126+
int totalFiles = data[2];
127+
var percent = (currentFile / totalFiles) * 100;
128+
if (percent.toInt() % 5 == 0) {
129+
varStore.setLoadingStatus('${strController.installingStr.value} $name');
130+
varStore.setLoadingPercent(percent.toInt());
131+
}
132+
if (percent == 100) {
133+
percentUnZip = percentUnZip + 100;
134+
}
135+
var nooffiles = files(arch).length;
136+
if (percentUnZip == nooffiles * 100) {
137+
if (requiresPatching()) {
138+
var patchFile = File(dataDir + '/$buildNumber.patched');
139+
if (!patchFile.existsSync()) {
140+
patchFile.createSync(recursive: true);
141+
}
140142
}
143+
printOut('Installation Completed', isNative: true);
144+
makeExecHelper().then((value) => isExecPermitted = value);
145+
uninstallModules();
146+
check();
141147
}
142-
printOut('Installation Completed', isNative: true);
143-
makeExecHelper().then((value) => isExecPermitted = value);
144-
uninstallModules();
145-
check();
146-
}
147-
});
148+
});
149+
}
148150
}
149151

150152
void _unbindUnZipIsolate() {
@@ -286,14 +288,15 @@ unZipinBgWin() async {
286288
File item = File(dataDir + sep + 'ZeroNet-win.zip');
287289
var name = item.path.split(sep).last;
288290
zeroNetState = state.INSTALLING;
289-
await compute(
290-
_unzipBytesAsyncWin,
291-
UnzipParams(
292-
name,
293-
item.readAsBytesSync(),
294-
dest: '',
295-
),
296-
);
291+
if (item.existsSync())
292+
await compute(
293+
_unzipBytesAsyncWin,
294+
UnzipParams(
295+
name,
296+
item.readAsBytesSync(),
297+
dest: '',
298+
),
299+
);
297300
check();
298301
}
299302

@@ -307,32 +310,38 @@ void _unzipBytesAsyncWin(UnzipParams params) async {
307310
}
308311
printOut("UnZippingFiles.......");
309312
var out = dataDir + '/' + params.dest;
310-
Archive archive = ZipDecoder().decodeBytes(params.bytes);
311-
int totalfiles = archive.length;
312-
int i = 0;
313-
for (ArchiveFile file in archive) {
314-
String filename = file.name;
315-
printOut('$out$filename');
316-
i++;
317-
final SendPort send = IsolateNameServer.lookupPortByName(isolateUnZipPort);
318-
send.send([params.item, i, totalfiles]);
319-
String outName = '$out' + filename;
320-
if (file.isFile) {
321-
List<int> data = file.content;
322-
// if (!File(outName).existsSync()) {
323-
File f = File(outName);
324-
if (!f.existsSync())
325-
f
326-
..createSync(recursive: true)
327-
..writeAsBytesSync(data);
328-
// }
329-
} else {
330-
Directory(outName).exists().then((exists) {
331-
if (!exists) Directory(outName)..create(recursive: true);
332-
});
313+
try {
314+
Archive archive = ZipDecoder().decodeBytes(params.bytes);
315+
int totalfiles = archive.length;
316+
int i = 0;
317+
for (ArchiveFile file in archive) {
318+
String filename = file.name;
319+
printOut('$out$filename');
320+
i++;
321+
final SendPort send =
322+
IsolateNameServer.lookupPortByName(isolateUnZipPort);
323+
send.send([params.item, i, totalfiles]);
324+
String outName = '$out' + filename;
325+
if (file.isFile) {
326+
List<int> data = file.content;
327+
// if (!File(outName).existsSync()) {
328+
File f = File(outName);
329+
if (!f.existsSync())
330+
f
331+
..createSync(recursive: true)
332+
..writeAsBytesSync(data);
333+
// }
334+
} else {
335+
Directory(outName).exists().then((exists) {
336+
if (!exists) Directory(outName)..create(recursive: true);
337+
});
338+
}
333339
}
340+
File(installedMetaDir(metaDir.path, params.item))
341+
.createSync(recursive: true);
342+
} catch (e) {
343+
printOut(e.toString());
334344
}
335-
File(installedMetaDir(metaDir.path, params.item)).createSync(recursive: true);
336345
}
337346

338347
void _unzipBytesAsync(UnzipParams params) async {

lib/widgets/home_page.dart

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class HomePage extends StatelessWidget {
2222
padding: EdgeInsets.only(bottom: 30),
2323
),
2424
ZeroNetStatusWidget(),
25+
if (PlatformExt.isDesktop) SizedBox(height: 8),
2526
ZeroNetUserStatusWidget(),
2627
Padding(
2728
padding: EdgeInsets.only(bottom: 15),
@@ -334,7 +335,8 @@ class PopularZeroNetSites extends StatelessWidget {
334335
bool isZite1Exists = isZiteExitsLocally(
335336
Utils.initialSites[item1]['btcAddress'],
336337
);
337-
return isZite1Exists ? 0 : 1;
338+
//TODO: Check if this breaks in mobile sorting
339+
return !isZite1Exists ? 0 : 1;
338340
});
339341
}
340342
for (var key in siteKeys) {
@@ -371,6 +373,10 @@ class PopularZeroNetSites extends StatelessWidget {
371373
),
372374
],
373375
),
376+
if (PlatformExt.isDesktop)
377+
SizedBox(
378+
height: 10,
379+
),
374380
ListView(
375381
shrinkWrap: true,
376382
children: zeroSites,

lib/widgets/settings_page.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class SettingsPage extends StatelessWidget {
1717
child: Column(
1818
children: <Widget>[
1919
ZeroNetAppBar(),
20+
if (PlatformExt.isDesktop) SizedBox(height: 8),
2021
ListView.builder(
2122
physics: BouncingScrollPhysics(),
2223
shrinkWrap: true,

0 commit comments

Comments
 (0)