Fix various bugs and shit

This commit is contained in:
2025-05-24 01:07:08 +02:00
parent 3c1f31d29b
commit 6eb55c5d50
2 changed files with 6 additions and 10 deletions

View File

@@ -614,17 +614,13 @@ class MainPageState extends State<MainPage> with WindowListener {
Duration newInterval = Duration(minutes: newIntervalMinutes);
if (newInterval != _currentPopupInterval) {
_currentPopupInterval = newInterval;
DB.setSetting('popupIntervalMinutes', newIntervalMinutes.toString());
await setPopupInterval(newInterval);
_startPopupTimer();
} else {
DB.setSetting('popupIntervalMinutes', newIntervalMinutes.toString());
}
if (soundStr != _currentNotificationSound) {
_currentNotificationSound = soundStr;
DB.setSetting('notificationSound', soundStr);
} else {
DB.setSetting('notificationSound', soundStr);
await setNotificationSound(soundStr);
}
// Also save volume

View File

@@ -171,7 +171,7 @@ Future<void> setSetting(String key, String value) async {
headers: header,
body: jsonEncode(document),
);
if (response.statusCode != 200) {
if (response.statusCode != 202) {
throw Exception('Failed to set settings');
}
}
@@ -181,7 +181,7 @@ Future<void> setSetting(String key, String value) async {
Future<List<Note>> searchNotes(String query) async {
final searchCondition = MeilisearchQuery(
q: query,
limit: 1000,
limit: 10,
attributesToHighlight: ['content'],
showRankingScore: true,
highlightPreTag: '<b>',
@@ -201,7 +201,7 @@ Future<List<Note>> searchNotes(String query) async {
(hit) => Note(
id: hit['id'] as String,
epochTime: hit['date'] as int,
content: hit['content'] as String,
content: hit['_formatted']['content'] as String,
),
)
.toList();
@@ -336,7 +336,7 @@ Future<Note> createNote(String content) async {
headers: header,
body: jsonEncode(document),
);
if (response.statusCode != 200) {
if (response.statusCode != 202) {
throw Exception('Failed to create note');
}
return Note(