File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
src/main/java/io/github/juby210/acplugins/messagelogger Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 1
- version = " 1.1.3 "
1
+ version = " 1.1.4 "
2
2
description = " Saves deleted / edited messages to a SQLite database and restores them when the channel is opened."
3
3
4
4
aliucord.changelog.set("""
5
+ 1.1.4
6
+ ======================
7
+
8
+ * fix setting not saving correctly
9
+
5
10
1.1.3
11
+ ======================
6
12
7
13
* fix spamming debug logs with NPE
8
14
Original file line number Diff line number Diff line change @@ -111,11 +111,14 @@ public void clearChannels() {
111
111
}
112
112
113
113
public void setBoolSetting (String key , Boolean value ) {
114
- String query = "UPDATE " + TABLE_NAME_SETTINGS + " SET value = ? WHERE name = ?" ;
114
+ String query = "SELECT * FROM " + TABLE_NAME_SETTINGS + " WHERE name = ?" ;
115
115
try (Cursor cursor = db .rawQuery (query , new String []{ key })) {
116
116
if (cursor .getCount () == 0 ) {
117
117
query = "INSERT INTO " + TABLE_NAME_SETTINGS + " (name, value) VALUES (?, ?)" ;
118
118
db .execSQL (query , new Object []{ key , String .valueOf (value ) });
119
+ } else {
120
+ query = "UPDATE " + TABLE_NAME_SETTINGS + " SET value = ? WHERE name = ?" ;
121
+ db .execSQL (query , new Object []{ String .valueOf (value ), key });
119
122
}
120
123
}
121
124
}
You can’t perform that action at this time.
0 commit comments