Skip to content

Commit ae1cdad

Browse files
committed
Fixed Parse logout and unpin
1 parent 652c6db commit ae1cdad

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

lib/src/objects/parse_base.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,10 @@ abstract class ParseBase {
147147
/// Saves item to simple key pair value storage
148148
///
149149
/// Replicates Android SDK pin process and saves object to storage
150-
Future<bool> unpin() async {
150+
Future<bool> unpin({String key}) async {
151151
if (objectId != null) {
152152
await SharedPreferences.getInstance()
153-
..remove(objectId);
153+
..remove(key ?? objectId);
154154
return true;
155155
}
156156

lib/src/objects/parse_user.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ class ParseUser extends ParseObject implements ParseCloneable {
198198
/// Removes the current user from the session data
199199
logout() {
200200
_client.data.sessionId = null;
201-
unpin();
201+
unpin(key: keyParseStoreUser);
202202
setObjectData(null);
203203
}
204204

test/parse_client_configuration_test.dart

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import 'package:test/test.dart';
21
import 'package:parse_server_sdk/parse.dart';
2+
import 'package:test/test.dart';
33

4-
void main(){
5-
test("testBuilder",() {
6-
Parse().initialize("appId",
7-
"serverUrl",
4+
void main() {
5+
test("testBuilder", () {
6+
Parse().initialize("appId", "serverUrl",
87
clientKey: "clientKey",
98
liveQueryUrl: "liveQueryUrl",
109
appName: "appName",
@@ -20,6 +19,5 @@ void main(){
2019
expect(ParseCoreData().masterKey, "masterKey");
2120
expect(ParseCoreData().sessionId, "sessionId");
2221
expect(ParseCoreData().debug, true);
23-
2422
});
25-
}
23+
}

0 commit comments

Comments
 (0)