Skip to content

Commit

Permalink
Add mechanism to clear personal data
Browse files Browse the repository at this point in the history
  • Loading branch information
cachapa committed Dec 25, 2023
1 parent e4e8be7 commit 6496b57
Show file tree
Hide file tree
Showing 15 changed files with 218 additions and 208 deletions.
Binary file removed assets/images/libra_icon.png
Binary file not shown.
Binary file removed assets/images/storyark_icon.png
Binary file not shown.
4 changes: 0 additions & 4 deletions l10n/app_de.arb
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@
"@aboutTudo": {},
"otherApps": "Weitere Apps",
"@otherApps": {},
"storyArkDescription": "Privates und sicheres soziales Mediennetzwerk",
"@storyArkDescription": {},
"libraDescription": "Gewichtsmanager mit dynamischer grafischer Darstellung",
"@libraDescription": {},
"today": "Heute",
"@today": {},
"yesterday": "Gestern",
Expand Down
66 changes: 63 additions & 3 deletions l10n/app_en.arb
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"theme": "Theme",
"@theme": {},
"scanQrCode": "Scan QR code",
"@scanQrCode": {},
"close": "Close",
"@close": {},
"listDeleted": "{name} deleted",
"@listDeleted": {
"placeholders": {
Expand All @@ -11,9 +14,13 @@
}
},
"createList": "Create list",
"@createList": {},
"createAList": "Create a list",
"@createAList": {},
"editList": "Edit list",
"@editList": {},
"members": "Members",
"@members": {},
"memberCount": "{count, plural, =1{1 member} other{{count} members}}",
"@memberCount": {
"placeholders": {
Expand All @@ -23,13 +30,21 @@
}
},
"you": "You",
"@you": {},
"share": "Share",
"@share": {},
"leaveList": "Leave list",
"@leaveList": {},
"removeList": "Remove list",
"@removeList": {},
"listUnavailable": "List unavailable",
"@listUnavailable": {},
"anonymous": "Anonymous",
"@anonymous": {},
"removeConfirmation": "Remove user from list",
"@removeConfirmation": {},
"remove": "Remove",
"@remove": {},
"userRemoved": "Removed {name}",
"@userRemoved": {
"placeholders": {
Expand All @@ -39,13 +54,21 @@
}
},
"name": "Name",
"@name": {},
"nameCaption": "Visible on shared lists",
"@nameCaption": {},
"create": "Create",
"@create": {},
"update": "Update",
"@update": {},
"cancel": "Cancel",
"@cancel": {},
"addItem": "Add item",
"@addItem": {},
"editItem": "Edit item",
"@editItem": {},
"toDoListEmptyMessage": "Create a new to-do item below",
"@toDoListEmptyMessage": {},
"itemDeleted": "Deleted \"{name}\"",
"@itemDeleted": {
"placeholders": {
Expand All @@ -63,15 +86,21 @@
}
},
"completed": "Completed",
"@completed": {},
"settings": "Settings",
"@settings": {},
"aboutTudo": "About tudo",
"@aboutTudo": {},
"sendFeedback": "Send feedback",
"@sendFeedback": {},
"reportIssues": "Report issues",
"@reportIssues": {},
"privacyPolicy": "Privacy policy",
"@privacyPolicy": {},
"licenses": "Licenses",
"@licenses": {},
"otherApps": "Other apps",
"storyArkDescription": "Private & secure social network dedicated to media sharing",
"libraDescription": "Weight manager with smooth dynamic charts",
"@otherApps": {},
"version": "Version {version}",
"@version": {
"placeholders": {
Expand All @@ -81,8 +110,11 @@
}
},
"today": "Today",
"@today": {},
"yesterday": "Yesterday",
"@yesterday": {},
"copyLink": "Copy link",
"@copyLink": {},
"listShareMessage": "Tap to open \"{listName}\" in your device:\n{shareUrl}",
"@listShareMessage": {
"placeholders": {
Expand All @@ -95,21 +127,49 @@
}
},
"clearCompleted": "Clear completed",
"@clearCompleted": {},
"delete": "Delete",
"@delete": {},
"joiningList": "Joining list…",
"@joiningList": {},
"listAlreadyJoined": "List already joined",
"@listAlreadyJoined": {},
"accountKey": "Account key",
"@accountKey": {},
"accountKeyExplanation": "You can use this key to recover your account, or open it in another device.",
"@accountKeyExplanation": {},
"accountKeyAdvice": "Store it in a safe place.",
"@accountKeyAdvice": {},
"startFromCleanSlate": "Start from a clean slate",
"@startFromCleanSlate": {},
"or": "or",
"@or": {},
"linkExistingAccount": "Link existing account",
"@linkExistingAccount": {},
"scanAccountKeyExplanation": "Scan your account key from the settings page in your other device.",
"@scanAccountKeyExplanation": {},
"deletedItems": "Deleted items",
"@deletedItems": {},
"restore": "Restore",
"@restore": {},
"noDeletedItems": "No deleted items",
"@noDeletedItems": {},
"restoringAccount": "Restoring account…",
"@restoringAccount": {},
"updateApp": "Update app",
"@updateApp": {},
"translateApp": "Translate tudo",
"translateAppDescription": "Make the app more accessible in your language"
"@translateApp": {},
"translateAppDescription": "Make the app more accessible in your language",
"@translateAppDescription": {},
"manageAccount": "Manage account",
"@manageAccount": {},
"codeFailedToMatch": "Code did not match",
"@codeFailedToMatch": {},
"deleteData": "Delete data",
"@deleteData": {},
"deleteDataConfirmation": "Enter \"{code}\" to confirm",
"@deleteDataConfirmation": {},
"dataDeleted": "Data deleted",
"@dataDeleted": {}
}
16 changes: 11 additions & 5 deletions l10n/app_pt.arb
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@
"@aboutTudo": {},
"otherApps": "Outras apps",
"@otherApps": {},
"storyArkDescription": "Rede social para a partilha de média",
"@storyArkDescription": {},
"libraDescription": "Gestor de peso com gráficos dinâmicos",
"@libraDescription": {},
"today": "Hoje",
"@today": {},
"yesterday": "Ontem",
Expand Down Expand Up @@ -120,5 +116,15 @@
"translateApp": "Traduz o tudo",
"@translateApp": {},
"translateAppDescription": "Torna a app mais acessível na tua língua",
"@translateAppDescription": {}
"@translateAppDescription": {},
"codeFailedToMatch": "Os códigos não condizem",
"@codeFailedToMatch": {},
"deleteData": "Apagar dados",
"@deleteData": {},
"manageAccount": "Gerir conta",
"@manageAccount": {},
"dataDeleted": "Dados apagados",
"@dataDeleted": {},
"deleteDataConfirmation": "Inserir \"{code}\" para cofirmar",
"@deleteDataConfirmation": {}
}
6 changes: 5 additions & 1 deletion lib/auth/auth_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'package:sqlite_crdt/sqlite_crdt.dart';
import '../config.dart';
import '../extensions.dart';
import '../sync/api_client.dart';
import '../util/store.dart';
import '../util/store_provider.dart';
import '../util/uuid.dart';

class AuthProvider {
Expand Down Expand Up @@ -38,6 +38,10 @@ class AuthProvider {
_storeCredentials(token, userId);
}

Future<void> deleteData() async {
await ApiClient(token).delete(serverUri.apply('user/$userId'));
}

void _storeCredentials(String token, String userId) {
assert(!_store.contains('token'));
assert(!_store.contains('user_id'));
Expand Down
4 changes: 2 additions & 2 deletions lib/config.dart
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// final serverUri = Uri.parse('http://localhost:8080');
final serverUri = Uri.parse('http://192.168.0.116:8080');
final serverUri = Uri.parse('http://localhost:8080');
// final serverUri = Uri.parse('http://192.168.0.116:8080');
2 changes: 1 addition & 1 deletion lib/lists/list_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import '../auth/auth_provider.dart';
import '../common/lists.dart';
import '../contacts/contact_provider.dart';
import '../extensions.dart';
import '../util/store.dart';
import '../util/store_provider.dart';
import '../util/uuid.dart';

const listIdsKey = 'list_id_keys';
Expand Down
2 changes: 1 addition & 1 deletion lib/registry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import 'crdt/tudo_crdt.dart';
import 'lists/list_provider.dart';
import 'settings/settings_provider.dart';
import 'sync/sync_provider.dart';
import 'util/store.dart';
import 'util/store_provider.dart';

export 'util/durations.dart';

Expand Down
Loading

0 comments on commit 6496b57

Please sign in to comment.