Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
edit_task,
delete_task,
get_user_task,
get_group
get_group,
create_group,
leave_group,
delete_group,
Expand Down Expand Up @@ -234,8 +234,24 @@ def handle_login() -> Response:
make_new_log("login", e)
return response_json

try:
data_con = connect("data/data.db")
data_cursor = data_con.cursor()
data_cursor.execute(
"SELECT username FROM user WHERE uuid = ?;",
(user_id,),
)
username = data_cursor.fetchone()[0]
data_con.close()
except Exception as e:
response_json = jsonify(
[{"error_no": "2", "message": "Trouble with backend! Sorry!"}]
)
make_new_log("login", e)
return response_json

response_json = jsonify(
[{"error_no": "0", "message": "success", "user_id": user_id}]
[{"error_no": "0", "message": "success", "user_id": user_id, "username": username}]
)
return response_json

Expand Down Expand Up @@ -1061,7 +1077,7 @@ def handle_invite_to_group() -> Response:

try:
# Verify password before inviting
if not check_password(connect("../data/data.db"), inviter_id, password):
if not check_password(connect("data/data.db"), inviter_id, password):
response_json = jsonify(
[{"error_no": "4", "message": "Password is incorrect"}]
)
Expand Down Expand Up @@ -1174,6 +1190,7 @@ def handle_respond_to_invite() -> Response:
response_json = jsonify([{"error_no": "0", "message": f"Successfully {status} invitation"}])
return response_json


if __name__ == "__main__":
print("Running main.py")
make_new_log("main", "Server started") # type: ignore
Expand Down
4 changes: 2 additions & 2 deletions roomiebuddy/lib/NavScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:roomiebuddy/providers/theme_provider.dart';
import 'pages/home_page.dart';
import 'pages/calendar_page.dart';
import 'pages/add_taskpage.dart';
import 'pages/add_roomate_page.dart';
import 'pages/group_page.dart';
import 'pages/settings_page.dart';

class Navscreen extends StatefulWidget {
Expand All @@ -21,7 +21,7 @@ class _NavscreenState extends State<Navscreen> {
HomePage(),
CalendarPage(),
AddTaskpage(),
AddRoomatePage(),
GroupPage(),
SettingsPage(),
];
int selectedIndex = 0;
Expand Down
7 changes: 3 additions & 4 deletions roomiebuddy/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@ class MyApp extends StatelessWidget {

@override
Widget build(BuildContext context) {
final themeProvider = Provider.of<ThemeProvider>(context);

return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Roomie Buddy',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
theme: themeProvider.themeData,
home: const LoginScreen(clearCredentials: false), // Set to false to enable "remember me" functionality
);
}
Expand Down
289 changes: 0 additions & 289 deletions roomiebuddy/lib/pages/add_roomate_page.dart

This file was deleted.

8 changes: 7 additions & 1 deletion roomiebuddy/lib/pages/add_taskpage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ class _AddTaskpageState extends State<AddTaskpage> {

return Scaffold(
appBar: AppBar(
title: Text('Add Task', style: TextStyle(color: themeProvider.lightTextColor)),
title: Text(
'Add Task',
style: TextStyle(
color: themeProvider.currentTextColor,
fontWeight: FontWeight.bold
),
),
),
body: SingleChildScrollView(
padding: const EdgeInsets.all(16.0),
Expand Down
Loading
Loading