Skip to content

Commit fb45126

Browse files
committed
fix: disable Analytics
1 parent 25c9c17 commit fb45126

File tree

2 files changed

+25
-13
lines changed

2 files changed

+25
-13
lines changed

bin/stacked.dart

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@ Future<void> main(List<String> arguments) async {
2727
negatable: false,
2828
help: kCommandHelpVersion,
2929
)
30-
..argParser.addFlag(
31-
ksEnableAnalytics,
32-
negatable: false,
33-
help: kCommandHelpEnableAnalytics,
34-
)
35-
..argParser.addFlag(
36-
ksDisableAnalytics,
37-
negatable: false,
38-
help: kCommandHelpDisableAnalytics,
39-
)
30+
// ..argParser.addFlag(
31+
// ksEnableAnalytics,
32+
// negatable: false,
33+
// help: kCommandHelpEnableAnalytics,
34+
// )
35+
// ..argParser.addFlag(
36+
// ksDisableAnalytics,
37+
// negatable: false,
38+
// help: kCommandHelpDisableAnalytics,
39+
// )
4040
..addCommand(CreateCommand())
4141
..addCommand(DeleteCommand())
4242
..addCommand(CompileCommand())
@@ -52,7 +52,9 @@ Future<void> main(List<String> arguments) async {
5252
exit(0);
5353
}
5454

55-
if (_handleAnalytics(argResults)) exit(0);
55+
/// Disable Analytics until we find how to resolve FileSystemException
56+
/// triggered twice
57+
// if (_handleAnalytics(argResults)) exit(0);
5658

5759
await _notifyNewVersionAvailable(arguments: arguments);
5860

lib/src/services/posthog_service.dart

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,30 @@ class PosthogService {
2525
final _baseUri = Uri.parse('https://app.posthog.com/capture');
2626

2727
/// Is this the first time the tool has run?
28-
bool get isFirstRun => _box.get(_isFirstRunKey, defaultValue: true);
28+
// bool get isFirstRun => _box.get(_isFirstRunKey, defaultValue: true);
29+
bool get isFirstRun => false;
2930

3031
/// Will analytics data be sent?
31-
bool get enabled => _box.get(_isEnabledKey, defaultValue: false);
32+
// bool get enabled => _box.get(_isEnabledKey, defaultValue: false);
33+
bool get enabled => false;
3234

3335
/// Enables or disables sending of analytics data.
3436
Future<void> enable(bool value) async {
37+
/// Disable Analytics until we find how to resolve FileSystemException
38+
/// triggered twice
39+
return;
40+
3541
await _box.put(_isFirstRunKey, false);
3642
await _box.put(_isEnabledKey, value);
3743
}
3844

3945
late Box _box;
4046

4147
Future<void> init() async {
48+
/// Disable Analytics until we find how to resolve FileSystemException
49+
/// triggered twice
50+
return;
51+
4252
Hive.init('${_pathService.configHome.path}/stacked');
4353

4454
_box = await Hive.openBox(

0 commit comments

Comments
 (0)