Skip to content

Commit

Permalink
Added login button
Browse files Browse the repository at this point in the history
  • Loading branch information
HarlJo committed Mar 22, 2024
1 parent efb6a64 commit bf23a3f
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 12 deletions.
1 change: 1 addition & 0 deletions lib/generated/intl/messages_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ class MessageLookup extends MessageLookupByLibrary {
"loadTweetCounterMaximumSubtitle": MessageLookupByLibrary.simpleMessage(
"Maximum of post`s loads while showing less than 5 posts"),
"logging": MessageLookupByLibrary.simpleMessage("Logging"),
"login": MessageLookupByLibrary.simpleMessage("Login"),
"loginNameTwitterAcc": MessageLookupByLibrary.simpleMessage("Username"),
"media": MessageLookupByLibrary.simpleMessage("Media"),
"media_size": MessageLookupByLibrary.simpleMessage("Media size"),
Expand Down
10 changes: 10 additions & 0 deletions lib/generated/l10n.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@
"loginNameTwitterAcc": "Username",
"passwordTwitterAcc": "Password",
"emailTwitterAcc": "Email",
"login": "Login",
"twitterCookiesDeleted": "All cookies of the account are deleted",
"DeleteTwitterCookies": "Delete all cookies of the account",
"tweetFilters": "Filters",
Expand Down
44 changes: 32 additions & 12 deletions lib/settings/_account.dart
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,38 @@ class SettingsAccountFragment extends StatelessWidget {
),
],
),
OutlinedButton(
onPressed: () async {
await model.DeleteAllCookies();
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
L10n.of(context).twitterCookiesDeleted,
),
),
);
},
child: Text(L10n.of(context).DeleteTwitterCookies))
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
FilledButton(
onPressed: () async {
await model.DeleteAllCookies();
await model.GetAuthHeader({
'user-agent':
"Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Mobile Safari/537.3",
// "Pragma": "no-cache",
"Cache-Control": "no-cache"
// "If-Modified-Since": "Sat, 1 Jan 2000 00:00:00 GMT",
});
},
child: Text(L10n.of(context).login)),
SizedBox(
width: 10,
),
OutlinedButton(
onPressed: () async {
await model.DeleteAllCookies();
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
L10n.of(context).twitterCookiesDeleted,
),
),
);
},
child: Text(L10n.of(context).DeleteTwitterCookies))
],
)
]),
),
);
Expand Down

0 comments on commit bf23a3f

Please sign in to comment.